mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 18:08:38 -06:00
Fixes #199: Moved prefix_validator from BaseIPField to IPNetworkField
This commit is contained in:
parent
7f353e88c9
commit
d974cecda3
@ -16,7 +16,6 @@ def prefix_validator(prefix):
|
|||||||
|
|
||||||
|
|
||||||
class BaseIPField(models.Field):
|
class BaseIPField(models.Field):
|
||||||
default_validators = [prefix_validator]
|
|
||||||
|
|
||||||
def python_type(self):
|
def python_type(self):
|
||||||
return IPNetwork
|
return IPNetwork
|
||||||
@ -51,6 +50,7 @@ class IPNetworkField(BaseIPField):
|
|||||||
IP prefix (network and mask)
|
IP prefix (network and mask)
|
||||||
"""
|
"""
|
||||||
description = "PostgreSQL CIDR field"
|
description = "PostgreSQL CIDR field"
|
||||||
|
default_validators = [prefix_validator]
|
||||||
|
|
||||||
def db_type(self, connection):
|
def db_type(self, connection):
|
||||||
return 'cidr'
|
return 'cidr'
|
||||||
|
@ -11,7 +11,7 @@ except ImportError:
|
|||||||
"the documentation.")
|
"the documentation.")
|
||||||
|
|
||||||
|
|
||||||
VERSION = '1.0.7'
|
VERSION = '1.0.7-r1'
|
||||||
|
|
||||||
# Import local configuration
|
# Import local configuration
|
||||||
for setting in ['ALLOWED_HOSTS', 'DATABASE', 'SECRET_KEY']:
|
for setting in ['ALLOWED_HOSTS', 'DATABASE', 'SECRET_KEY']:
|
||||||
|
Loading…
Reference in New Issue
Block a user