mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-23 19:20:47 +02:00
fixed bugs in ip list handling, reformatted clean function in forms, removed custom field type for ip address in nameserverform
This commit is contained in:
parent
46f03cd4e4
commit
517390cc55
5 changed files with 56 additions and 58 deletions
|
@ -260,7 +260,7 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
"""Creates the host object in the registry
|
||||
doesn't add the created host to the domain
|
||||
returns ErrorCode (int)"""
|
||||
if addrs is not None:
|
||||
if addrs is not None and addrs != []:
|
||||
addresses = [epp.Ip(addr=addr) for addr in addrs]
|
||||
request = commands.CreateHost(name=host, addrs=addresses)
|
||||
else:
|
||||
|
@ -314,16 +314,14 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
NameserverError (if exception hit)
|
||||
Returns:
|
||||
None"""
|
||||
if cls.isSubdomain(name, nameserver) and (ip is None or ip == [] or ip == [""]):
|
||||
if cls.isSubdomain(name, nameserver) and (ip is None or ip == []):
|
||||
raise NameserverError(code=nsErrorCodes.MISSING_IP, nameserver=nameserver)
|
||||
|
||||
elif not cls.isSubdomain(name, nameserver) and (
|
||||
ip is not None and ip != [] and ip != [""]
|
||||
):
|
||||
elif not cls.isSubdomain(name, nameserver) and (ip is not None and ip != []):
|
||||
raise NameserverError(
|
||||
code=nsErrorCodes.GLUE_RECORD_NOT_ALLOWED, nameserver=nameserver, ip=ip
|
||||
)
|
||||
elif ip is not None and ip != [] and ip != [""]:
|
||||
elif ip is not None and ip != []:
|
||||
for addr in ip:
|
||||
if not cls._valid_ip_addr(addr):
|
||||
raise NameserverError(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue