mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #9687: Don't restrict custom text field lengths when entering via UI form
This commit is contained in:
@ -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:
|
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
|
* Long text: Free-form of any length; supports Markdown rendering
|
||||||
* Integer: A whole number (positive or negative)
|
* Integer: A whole number (positive or negative)
|
||||||
* Boolean: True or false
|
* Boolean: True or false
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* [#9632](https://github.com/netbox-community/netbox/issues/9632) - Automatically focus on search box when expanding dropdowns
|
* [#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
|
* [#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
|
* [#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
|
* [#9704](https://github.com/netbox-community/netbox/issues/9704) - Include `last_updated` field on JournalEntry REST API serializer
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -365,13 +365,8 @@ class CustomField(ExportTemplatesMixin, WebhooksMixin, ChangeLoggedModel):
|
|||||||
|
|
||||||
# Text
|
# Text
|
||||||
else:
|
else:
|
||||||
if self.type == CustomFieldTypeChoices.TYPE_LONGTEXT:
|
widget = forms.Textarea if self.type == CustomFieldTypeChoices.TYPE_LONGTEXT else None
|
||||||
max_length = None
|
field = forms.CharField(required=required, initial=initial, widget=widget)
|
||||||
widget = forms.Textarea
|
|
||||||
else:
|
|
||||||
max_length = 255
|
|
||||||
widget = None
|
|
||||||
field = forms.CharField(max_length=max_length, required=required, initial=initial, widget=widget)
|
|
||||||
if self.validation_regex:
|
if self.validation_regex:
|
||||||
field.validators = [
|
field.validators = [
|
||||||
RegexValidator(
|
RegexValidator(
|
||||||
|
Reference in New Issue
Block a user