mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-02 07:52:15 +02:00
Get all emails for domain managers and matching header title to be dynamic
This commit is contained in:
parent
0f41d64e0e
commit
a9302a8428
1 changed files with 8 additions and 1 deletions
|
@ -17,7 +17,7 @@ logger = logging.getLogger(__name__)
|
|||
def write_header(writer, columns):
|
||||
"""
|
||||
Receives params from the parent methods and outputs a CSV with a header row.
|
||||
Works with write_header as longas the same writer object is passed.
|
||||
Works with write_header as long as the same writer object is passed.
|
||||
"""
|
||||
writer.writerow(columns)
|
||||
|
||||
|
@ -92,6 +92,13 @@ def parse_row(columns, domain_info: DomainInformation, security_emails_dict=None
|
|||
"Deleted": domain.deleted,
|
||||
}
|
||||
|
||||
# Get each domain managers email and add to list
|
||||
dm_emails = [dm.email for dm in domain.permissions]
|
||||
|
||||
# Matching header for domain managers to be dynamic
|
||||
for i, dm_email in enumerate(dm_emails, start=1):
|
||||
FIELDS[f"Domain Manager email {i}":dm_email]
|
||||
|
||||
row = [FIELDS.get(column, "") for column in columns]
|
||||
return row
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue