Fine tuning

This commit is contained in:
zandercymatics 2024-06-05 15:13:36 -06:00
parent 6db7f138f4
commit f9cec62a03
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 81 additions and 51 deletions

View file

@ -124,6 +124,11 @@ class DomainRequest(TimeStampedModel):
SPECIAL_DISTRICT = "special_district", "Special district"
SCHOOL_DISTRICT = "school_district", "School district"
@classmethod
def get_org_label(cls, org_name: str):
"""Returns the associated label for a given org name"""
return cls(org_name).label if org_name else None
class OrgChoicesElectionOffice(models.TextChoices):
"""
Primary organization choices for Django admin:
@ -230,6 +235,11 @@ class DomainRequest(TimeStampedModel):
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
class RejectionReasons(models.TextChoices):
DOMAIN_PURPOSE = "purpose_not_met", "Purpose requirements not met"
REQUESTOR = "requestor_not_eligible", "Requestor not eligible to make request"