Skip to content

Commit

Permalink
Merge pull request #2516 from cisagov/rh/2475-add-election
Browse files Browse the repository at this point in the history
ISSUE #2475: Update for organization to have " - election"
  • Loading branch information
therealslimhsiehdy authored Aug 1, 2024
2 parents 5b81389 + 4b2919d commit b78f753
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/registrar/models/domain_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ def get_org_generic_to_org_election(cls):
}
return org_election_map

@classmethod
def get_org_label(cls, org_name: str):
# Translating the key that is given to the direct readable value
return cls(org_name).label if org_name else None

class OrganizationChoicesVerbose(models.TextChoices):
"""
Tertiary organization choices
Expand Down
5 changes: 3 additions & 2 deletions src/registrar/utility/csv_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,9 @@ def parse_row(cls, columns, model):
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
Expand Down

0 comments on commit b78f753

Please sign in to comment.