1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Move BGP_ASN_MIN and BGP_ASN_MAX to ipam.constants

This commit is contained in:
Jeremy Stretch
2020-01-15 14:53:46 -05:00
parent caf7d02637
commit 88267e9d05
4 changed files with 15 additions and 7 deletions

View File

@ -3,7 +3,7 @@ from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
from netaddr import AddrFormatError, EUI, mac_unix_expanded
from .constants import *
from ipam.constants import BGP_ASN_MAX, BGP_ASN_MIN
class ASNField(models.BigIntegerField):
@ -14,7 +14,10 @@ class ASNField(models.BigIntegerField):
]
def formfield(self, **kwargs):
defaults = {'min_value': BGP_ASN_MIN, 'max_value': BGP_ASN_MAX}
defaults = {
'min_value': BGP_ASN_MIN,
'max_value': BGP_ASN_MAX,
}
defaults.update(**kwargs)
return super().formfield(**defaults)