mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Merge pull request #10253 from netbox-community/9823-fix_numericarrayfield_validation_error
Fixes #9823 - Make validation error from NumericArrayField more verbose.
This commit is contained in:
commit
572803d7ac
@ -110,6 +110,12 @@ class SelectSpeedWidget(forms.NumberInput):
|
||||
|
||||
class NumericArrayField(SimpleArrayField):
|
||||
|
||||
def clean(self, value):
|
||||
if value and not self.to_python(value):
|
||||
raise forms.ValidationError(f'Invalid list ({value}). '
|
||||
f'Must be numeric and ranges must be in ascending order')
|
||||
return super().clean(value)
|
||||
|
||||
def to_python(self, value):
|
||||
if not value:
|
||||
return []
|
||||
|
Loading…
Reference in New Issue
Block a user