diff --git a/src/registrar/models/domain_request.py b/src/registrar/models/domain_request.py index 3a9024c72..40dc26c95 100644 --- a/src/registrar/models/domain_request.py +++ b/src/registrar/models/domain_request.py @@ -248,11 +248,6 @@ class DomainRequest(TimeStampedModel): "School district: a school district that is not part of a local government", ) - @classmethod - def get_branch_label(cls, branch_name: str): - """Returns the associated label for a given org name""" - return cls(branch_name).label if branch_name else None - class RejectionReasons(models.TextChoices): DOMAIN_PURPOSE = "purpose_not_met", "Purpose requirements not met" REQUESTOR = "requestor_not_eligible", "Requestor not eligible to make request" diff --git a/src/registrar/utility/constants.py b/src/registrar/utility/constants.py index 9ec5e7d5e..9b6c3f71d 100644 --- a/src/registrar/utility/constants.py +++ b/src/registrar/utility/constants.py @@ -5,3 +5,8 @@ class BranchChoices(models.TextChoices): EXECUTIVE = "executive", "Executive" JUDICIAL = "judicial", "Judicial" LEGISLATIVE = "legislative", "Legislative" + + @classmethod + def get_branch_label(cls, branch_name: str): + """Returns the associated label for a given org name""" + return cls(branch_name).label if branch_name else None diff --git a/src/registrar/utility/csv_export.py b/src/registrar/utility/csv_export.py index dc5910b7f..91f93e011 100644 --- a/src/registrar/utility/csv_export.py +++ b/src/registrar/utility/csv_export.py @@ -18,6 +18,8 @@ from django.contrib.postgres.aggregates import StringAgg from registrar.models.utility.generic_helper import convert_queryset_to_dict from registrar.templatetags.custom_filters import get_region from registrar.utility.enums import DefaultEmail +from registrar.utility.constants import BranchChoices + logger = logging.getLogger(__name__) @@ -893,11 +895,11 @@ class DomainRequestExport: # Handle the federal_type field. Defaults to the wrong format. federal_type = request.get("federal_type") human_readable_federal_type = ( - DomainRequest.BranchChoices.get_branch_label(federal_type) if federal_type else None + BranchChoices.get_branch_label(federal_type) if federal_type else None ) # Handle the org_type field - org_type = request.get("organization_type") + org_type = request.get("generic_org_type") or request.get("organization_type") human_readable_org_type = DomainRequest.OrganizationChoices.get_org_label(org_type) if org_type else None # Handle the status field. Defaults to the wrong format.