mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-29 15:53:31 +02:00
refactored _get_contacts to return default dict when no contacts exist rather then empty dict
This commit is contained in:
parent
a587920c45
commit
2b55e40d57
1 changed files with 8 additions and 1 deletions
|
@ -1743,7 +1743,14 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
return dnssec_data
|
return dnssec_data
|
||||||
|
|
||||||
def _get_contacts(self, contacts):
|
def _get_contacts(self, contacts):
|
||||||
cleaned_contacts = {}
|
choices = PublicContact.ContactTypeChoices
|
||||||
|
# We expect that all these fields get populated,
|
||||||
|
# so we can create these early, rather than waiting.
|
||||||
|
cleaned_contacts = {
|
||||||
|
choices.ADMINISTRATIVE: None,
|
||||||
|
choices.SECURITY: None,
|
||||||
|
choices.TECHNICAL: None,
|
||||||
|
}
|
||||||
if contacts and isinstance(contacts, list) and len(contacts) > 0:
|
if contacts and isinstance(contacts, list) and len(contacts) > 0:
|
||||||
cleaned_contacts = self._fetch_contacts(contacts)
|
cleaned_contacts = self._fetch_contacts(contacts)
|
||||||
return cleaned_contacts
|
return cleaned_contacts
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue