Skip to content

Commit

Permalink
Merge pull request #1844 from cisagov/za/1840-staging-hotfix-csv-report
Browse files Browse the repository at this point in the history
(Based off of Staging) Ticket #1840: Hotfix for csv_export only populating 1 thousand records
  • Loading branch information
zandercymatics authored Feb 29, 2024
2 parents b355f18 + c17f248 commit 15fab5b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/registrar/utility/csv_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,12 @@ def write_csv(
max_dm_count = max(len(domain_info.domain.permissions.all()) for domain_info in all_domain_infos)
update_columns_with_domain_managers(columns, max_dm_count)

if should_write_header:
write_header(writer, columns)

for page_num in paginator.page_range:
page = paginator.page(page_num)
rows = []
page = paginator.page(page_num)
for domain_info in page.object_list:
try:
row = parse_row(columns, domain_info, security_emails_dict, get_domain_managers)
Expand All @@ -180,10 +183,7 @@ def write_csv(
logger.error("csv_export -> Error when parsing row, domain was None")
continue

if should_write_header:
write_header(writer, columns)

writer.writerows(rows)
writer.writerows(rows)


def export_data_type_to_csv(csv_file):
Expand Down

0 comments on commit 15fab5b

Please sign in to comment.