mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-02 01:03:28 +02:00
Cleanup
This commit is contained in:
parent
2f9c37e8ee
commit
dd57cf2ffd
1 changed files with 4 additions and 3 deletions
|
@ -1,7 +1,5 @@
|
||||||
from itertools import zip_longest
|
from itertools import zip_longest
|
||||||
import logging
|
import logging
|
||||||
from queue import Queue
|
|
||||||
from threading import Thread
|
|
||||||
from datetime import date
|
from datetime import date
|
||||||
from string import digits
|
from string import digits
|
||||||
from django_fsm import FSMField, transition # type: ignore
|
from django_fsm import FSMField, transition # type: ignore
|
||||||
|
@ -533,6 +531,9 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
)
|
)
|
||||||
raise (err)
|
raise (err)
|
||||||
elif alreadyExistsInRegistry:
|
elif alreadyExistsInRegistry:
|
||||||
|
# If this item already exists in the registry,
|
||||||
|
# but doesn't have other contacts, we want to
|
||||||
|
# delete the old value
|
||||||
filtered_contacts = PublicContact.objects.filter(
|
filtered_contacts = PublicContact.objects.filter(
|
||||||
registry_id=contact.registry_id
|
registry_id=contact.registry_id
|
||||||
)
|
)
|
||||||
|
@ -739,7 +740,7 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
# Saves to DB
|
# Saves to DB
|
||||||
if(create_object):
|
if(create_object):
|
||||||
create = PublicContact.objects.filter(registry_id=contact_id, contact_type=contact_type, domain=self)
|
create = PublicContact.objects.filter(registry_id=contact_id, contact_type=contact_type, domain=self)
|
||||||
if(create.count() == 0):
|
if(create.count() == 0 and contact_type != PublicContact.ContactTypeChoices.REGISTRANT):
|
||||||
desired_contact.save()
|
desired_contact.save()
|
||||||
|
|
||||||
return desired_contact
|
return desired_contact
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue