diff --git a/docs/models/extras/customfield.md b/docs/models/extras/customfield.md index da73816b6..e0c01688d 100644 --- a/docs/models/extras/customfield.md +++ b/docs/models/extras/customfield.md @@ -10,7 +10,7 @@ Within the database, custom fields are stored as JSON data directly alongside ea Custom fields may be created by navigating to Customization > Custom Fields. NetBox supports six types of custom field: -* Text: Free-form text (up to 255 characters) +* Text: Free-form text (intended for single-line use) * Long text: Free-form of any length; supports Markdown rendering * Integer: A whole number (positive or negative) * Boolean: True or false diff --git a/docs/release-notes/version-3.2.md b/docs/release-notes/version-3.2.md index 83c0765c3..86a352215 100644 --- a/docs/release-notes/version-3.2.md +++ b/docs/release-notes/version-3.2.md @@ -18,6 +18,7 @@ * [#9632](https://github.com/netbox-community/netbox/issues/9632) - Automatically focus on search box when expanding dropdowns * [#9657](https://github.com/netbox-community/netbox/issues/9657) - Fix filtering for custom fields and webhooks in the UI * [#9682](https://github.com/netbox-community/netbox/issues/9682) - Fix bulk assignment of ASNs to sites +* [#9687](https://github.com/netbox-community/netbox/issues/9687) - Don't restrict custom text field lengths when entering via UI form * [#9704](https://github.com/netbox-community/netbox/issues/9704) - Include `last_updated` field on JournalEntry REST API serializer --- diff --git a/netbox/extras/models/customfields.py b/netbox/extras/models/customfields.py index 49afe1bba..6a8c1dacf 100644 --- a/netbox/extras/models/customfields.py +++ b/netbox/extras/models/customfields.py @@ -365,13 +365,8 @@ class CustomField(ExportTemplatesMixin, WebhooksMixin, ChangeLoggedModel): # Text else: - if self.type == CustomFieldTypeChoices.TYPE_LONGTEXT: - max_length = None - widget = forms.Textarea - else: - max_length = 255 - widget = None - field = forms.CharField(max_length=max_length, required=required, initial=initial, widget=widget) + widget = forms.Textarea if self.type == CustomFieldTypeChoices.TYPE_LONGTEXT else None + field = forms.CharField(required=required, initial=initial, widget=widget) if self.validation_regex: field.validators = [ RegexValidator(