Fixes #3876: set min and max values for ASN field

This commit is contained in:
Saria Hajjar 2020-01-09 21:12:35 +00:00
parent 6019260374
commit 4eacc57522
2 changed files with 6 additions and 0 deletions

View File

@ -21,6 +21,7 @@
* [#3862](https://github.com/netbox-community/netbox/issues/3862) - Allow filtering device components by multiple device names
* [#3864](https://github.com/netbox-community/netbox/issues/3864) - Disallow /0 masks
* [#3872](https://github.com/netbox-community/netbox/issues/3872) - Paginate related IPs of an address
* [#3876](https://github.com/netbox-community/netbox/issues/3876) - Fixed min/max to ASN input field at the site creation page
---

View File

@ -11,6 +11,11 @@ class ASNField(models.BigIntegerField):
MaxValueValidator(4294967295),
]
def formfield(self, **kwargs):
defaults = {'min_value': 1, 'max_value': 4294967295}
defaults.update(**kwargs)
return super().formfield(**defaults)
class mac_unix_expanded_uppercase(mac_unix_expanded):
word_fmt = '%.2X'