From 6c82ec9dc296438a352890585f1d778ca8647ab4 Mon Sep 17 00:00:00 2001 From: Rebecca Hsieh Date: Tue, 30 Jul 2024 13:33:14 -0700 Subject: [PATCH 1/2] Update for organization to have election --- src/registrar/models/domain_request.py | 8 ++++++++ src/registrar/utility/csv_export.py | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/registrar/models/domain_request.py b/src/registrar/models/domain_request.py index a7252e16b..1ff1e501a 100644 --- a/src/registrar/models/domain_request.py +++ b/src/registrar/models/domain_request.py @@ -215,6 +215,14 @@ class DomainRequest(TimeStampedModel): } return org_election_map + @classmethod + def get_org_label(cls, org_name: str): + # Translating the key that is given to the direct readable value + if not org_name: + return None + + return cls(org_name).label if org_name else None + class OrganizationChoicesVerbose(models.TextChoices): """ Tertiary organization choices diff --git a/src/registrar/utility/csv_export.py b/src/registrar/utility/csv_export.py index 5fbd255aa..d852df5db 100644 --- a/src/registrar/utility/csv_export.py +++ b/src/registrar/utility/csv_export.py @@ -374,8 +374,9 @@ class DomainExport(BaseExport): if first_ready_on is None: first_ready_on = "(blank)" - domain_org_type = model.get("generic_org_type") - human_readable_domain_org_type = DomainRequest.OrganizationChoices.get_org_label(domain_org_type) + # organization_type has generic_org_type AND is_election + domain_org_type = model.get("organization_type") + human_readable_domain_org_type = DomainRequest.OrgChoicesElectionOffice.get_org_label(domain_org_type) domain_federal_type = model.get("federal_type") human_readable_domain_federal_type = BranchChoices.get_branch_label(domain_federal_type) domain_type = human_readable_domain_org_type From 4b2919d10850e8eed88bfa5e0c844852998af8bd Mon Sep 17 00:00:00 2001 From: "Rebecca H." Date: Thu, 1 Aug 2024 11:55:36 -0700 Subject: [PATCH 2/2] Update src/registrar/models/domain_request.py Co-authored-by: zandercymatics <141044360+zandercymatics@users.noreply.github.com> --- src/registrar/models/domain_request.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/registrar/models/domain_request.py b/src/registrar/models/domain_request.py index 1ff1e501a..363de213b 100644 --- a/src/registrar/models/domain_request.py +++ b/src/registrar/models/domain_request.py @@ -218,9 +218,6 @@ class DomainRequest(TimeStampedModel): @classmethod def get_org_label(cls, org_name: str): # Translating the key that is given to the direct readable value - if not org_name: - return None - return cls(org_name).label if org_name else None class OrganizationChoicesVerbose(models.TextChoices):