From 8e768112f3d55e072f5b4b9cc4d9fb9b5a861589 Mon Sep 17 00:00:00 2001 From: Rachid Mrad Date: Tue, 31 Oct 2023 10:52:00 -0400 Subject: [PATCH] Tweak domain type display by using get_organization_type_display and pulling federal_type if applicable --- src/registrar/tests/test_reports.py | 10 +++++----- src/registrar/utility/csv_export.py | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/registrar/tests/test_reports.py b/src/registrar/tests/test_reports.py index 3f6b36041..81380c929 100644 --- a/src/registrar/tests/test_reports.py +++ b/src/registrar/tests/test_reports.py @@ -113,9 +113,9 @@ class ExportDataTest(TestCase): "Domain name,Domain type,Federal agency,Organization name,City,State,AO," "AO email,Submitter,Submitter title,Submitter email,Submitter phone," "Security Contact Email,Status\n" - "adomain2.gov,interstate,dnsneeded\n" - "cdomain1.gov,federal,World War I Centennial Commission,ready\n" - "ddomain3.gov,federal,Armed Forces Retirement Home,onhold\n" + "adomain2.gov,Interstate,dnsneeded\n" + "cdomain1.gov,Federal,World War I Centennial Commission,ready\n" + "ddomain3.gov,Federal,Armed Forces Retirement Home,onhold\n" ) # Normalize line endings and remove commas, @@ -174,8 +174,8 @@ class ExportDataTest(TestCase): expected_content = ( "Domain name,Domain type,Federal agency,Organization name,City," "State,Security Contact Email\n" - "cdomain1.gov,federal,World War I Centennial Commission\n" - "ddomain3.gov,federal,Armed Forces Retirement Home\n" + "cdomain1.gov,Federal,World War I Centennial Commission\n" + "ddomain3.gov,Federal,Armed Forces Retirement Home\n" ) # Normalize line endings and remove commas, diff --git a/src/registrar/utility/csv_export.py b/src/registrar/utility/csv_export.py index e6bfb7334..339a42111 100644 --- a/src/registrar/utility/csv_export.py +++ b/src/registrar/utility/csv_export.py @@ -19,7 +19,10 @@ def export_domains_to_writer(writer, columns, sort_fields, filter_condition): # create a dictionary of fields which can be included in output FIELDS = { "Domain name": domainInfo.domain.name, - "Domain type": domainInfo.organization_type, + "Domain type": domainInfo.get_organization_type_display() + + " - " + domainInfo.federal_type + if domainInfo.federal_type + else domainInfo.get_organization_type_display(), "Federal agency": domainInfo.federal_agency, "Organization name": domainInfo.organization_name, "City": domainInfo.city,