Fixes / linter

This commit is contained in:
zandercymatics 2023-11-13 14:34:51 -07:00
parent 6f729ff693
commit 1b5ecc8e52
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 25 additions and 21 deletions

View file

@ -345,26 +345,7 @@ class Command(BaseCommand):
return updated return updated
def create_new_domain_info( def update_contact_info(self, first_name, middle_name, last_name, email, phone):
self,
transition_domain: TransitionDomain,
domain: Domain,
agency_choices,
fed_choices,
org_choices,
debug_on,
) -> DomainInformation:
org_type = ("", "")
fed_type = transition_domain.federal_type
fed_agency = transition_domain.federal_agency
# = AO Information = #
first_name = transition_domain.first_name
middle_name = transition_domain.middle_name
last_name = transition_domain.last_name
email = transition_domain.email
phone = transition_domain.phone
contact = None contact = None
contacts = Contact.objects.filter(email=email) contacts = Contact.objects.filter(email=email)
contact_count = contacts.count() contact_count = contacts.count()
@ -392,6 +373,29 @@ class Command(BaseCommand):
c.phone = phone c.phone = phone
c.save() c.save()
contact = c.first() contact = c.first()
return contact
def create_new_domain_info(
self,
transition_domain: TransitionDomain,
domain: Domain,
agency_choices,
fed_choices,
org_choices,
debug_on,
) -> DomainInformation:
org_type = ("", "")
fed_type = transition_domain.federal_type
fed_agency = transition_domain.federal_agency
# = AO Information = #
first_name = transition_domain.first_name
middle_name = transition_domain.middle_name
last_name = transition_domain.last_name
email = transition_domain.email
phone = transition_domain.phone
contact = self.update_contact_info(first_name, middle_name, last_name, email, phone)
if debug_on: if debug_on:
logger.info(f"Contact created: {contact}") logger.info(f"Contact created: {contact}")

View file

@ -24,7 +24,7 @@ def export_domains_to_writer(writer, columns, sort_fields, filter_condition):
"Organization name": domainInfo.organization_name, "Organization name": domainInfo.organization_name,
"City": domainInfo.city, "City": domainInfo.city,
"State": domainInfo.state_territory, "State": domainInfo.state_territory,
"AO": domainInfo.authorizing_official.first_name + " " + domainInfo.authorizing_official.last_name "AO": (domainInfo.authorizing_official.first_name or "") + " " + (domainInfo.authorizing_official.last_name or "")
if domainInfo.authorizing_official if domainInfo.authorizing_official
else " ", else " ",
"AO email": domainInfo.authorizing_official.email if domainInfo.authorizing_official else " ", "AO email": domainInfo.authorizing_official.email if domainInfo.authorizing_official else " ",