From 25723aebe0d1470e1dec43fec174ba9b3503ceeb Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 9 Feb 2024 15:57:42 -0500 Subject: [PATCH] Closes #15100: Remove obsolete NullableCharField class --- docs/release-notes/version-4.0.md | 1 + netbox/utilities/fields.py | 16 ---------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/docs/release-notes/version-4.0.md b/docs/release-notes/version-4.0.md index 21e442205..507b8dcdd 100644 --- a/docs/release-notes/version-4.0.md +++ b/docs/release-notes/version-4.0.md @@ -31,3 +31,4 @@ The NetBox user interface has been completely refreshed and updated. * [#14658](https://github.com/netbox-community/netbox/issues/14658) - Remove backward compatibility for importing `process_webhook()` (now `extras.webhooks.send_webhook()`) * [#14740](https://github.com/netbox-community/netbox/issues/14740) - Remove the obsolete `BootstrapMixin` form mixin class * [#15099](https://github.com/netbox-community/netbox/issues/15099) - Remove obsolete `device_role` and `device_role_id` filters for devices +* [#15100](https://github.com/netbox-community/netbox/issues/15100) - Remove obsolete `NullableCharField` class diff --git a/netbox/utilities/fields.py b/netbox/utilities/fields.py index 65e01db81..d2c14c2c7 100644 --- a/netbox/utilities/fields.py +++ b/netbox/utilities/fields.py @@ -12,26 +12,10 @@ __all__ = ( 'ColorField', 'CounterCacheField', 'NaturalOrderingField', - 'NullableCharField', 'RestrictedGenericForeignKey', ) -# Deprecated: Retained only to ensure successful migration from early releases -# Use models.CharField(null=True) instead -# TODO: Remove in v4.0 -class NullableCharField(models.CharField): - description = "Stores empty values as NULL rather than ''" - - def to_python(self, value): - if isinstance(value, models.CharField): - return value - return value or '' - - def get_prep_value(self, value): - return value or None - - class ColorField(models.CharField): default_validators = [ColorValidator] description = "A hexadecimal RGB color code"