mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-25 20:18:38 +02:00
Update csv_export.py
This commit is contained in:
parent
86dbe6b6a0
commit
0d64d9f040
1 changed files with 7 additions and 4 deletions
|
@ -13,9 +13,12 @@ def export_domains_to_writer(writer, columns, sort_fields, filter_condition):
|
||||||
domainInfos = DomainInformation.objects.filter(**filter_condition).order_by(*sort_fields)
|
domainInfos = DomainInformation.objects.filter(**filter_condition).order_by(*sort_fields)
|
||||||
for domainInfo in domainInfos:
|
for domainInfo in domainInfos:
|
||||||
security_contacts = domainInfo.domain.contacts.filter(contact_type=PublicContact.ContactTypeChoices.SECURITY)
|
security_contacts = domainInfo.domain.contacts.filter(contact_type=PublicContact.ContactTypeChoices.SECURITY)
|
||||||
ao = (
|
# For linter
|
||||||
(domainInfo.authorizing_official.first_name or "") + " " + (domainInfo.authorizing_official.last_name or "")
|
ao = " "
|
||||||
)
|
if domainInfo.authorizing_official:
|
||||||
|
first_name = domainInfo.authorizing_official.first_name or ""
|
||||||
|
last_name = domainInfo.authorizing_official.last_name or ""
|
||||||
|
ao = first_name + " " + last_name
|
||||||
# create a dictionary of fields which can be included in output
|
# create a dictionary of fields which can be included in output
|
||||||
FIELDS = {
|
FIELDS = {
|
||||||
"Domain name": domainInfo.domain.name,
|
"Domain name": domainInfo.domain.name,
|
||||||
|
@ -26,7 +29,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": ao if domainInfo.authorizing_official else " ",
|
"AO": ao,
|
||||||
"AO email": domainInfo.authorizing_official.email if domainInfo.authorizing_official else " ",
|
"AO email": domainInfo.authorizing_official.email if domainInfo.authorizing_official else " ",
|
||||||
"Security Contact Email": security_contacts[0].email if security_contacts else " ",
|
"Security Contact Email": security_contacts[0].email if security_contacts else " ",
|
||||||
"Status": domainInfo.domain.state,
|
"Status": domainInfo.domain.state,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue