-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
NetBox version
v3.2.5
Python version
3.9
Steps to Reproduce
- create a custom field of the type 'text'
- use the API to update that text field with a string > 255 characters
Expected Behavior
A validation error should be thrown, as custom TEXT fields should be limited to 255 characters
Observed Behavior
The length validation is only done in the 'form' and not in validate()
This part should also check the length of a TEXT custom field:
if self.type == CustomFieldTypeChoices.TYPE_TEXT and len(value) > 255:
raise ValidationError(f"Value cannot contain more than 255 characters")
Metadata
Metadata
Assignees
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application