mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-17 18:09:25 +02:00
cleanup
This commit is contained in:
parent
3754e0b48b
commit
41748e59f5
3 changed files with 25 additions and 9 deletions
|
@ -256,6 +256,11 @@ class DomainRequest(TimeStampedModel):
|
|||
NAMING_REQUIREMENTS = "naming_not_met", "Naming requirements not met"
|
||||
OTHER = "other", "Other/Unspecified"
|
||||
|
||||
@classmethod
|
||||
def get_rejection_reason_label(cls, rejection_reason: str):
|
||||
"""Returns the associated label for a given rejection reason"""
|
||||
return cls(rejection_reason).label if rejection_reason else None
|
||||
|
||||
class ActionNeededReasons(models.TextChoices):
|
||||
"""Defines common action needed reasons for domain requests"""
|
||||
|
||||
|
@ -265,6 +270,11 @@ class DomainRequest(TimeStampedModel):
|
|||
BAD_NAME = ("bad_name", "Doesn’t meet naming requirements")
|
||||
OTHER = ("other", "Other (no auto-email sent)")
|
||||
|
||||
@classmethod
|
||||
def get_action_needed_reason_label(cls, action_needed_reason: str):
|
||||
"""Returns the associated label for a given action needed reason"""
|
||||
return cls(action_needed_reason).label if action_needed_reason else None
|
||||
|
||||
# #### Internal fields about the domain request #####
|
||||
status = FSMField(
|
||||
choices=DomainRequestStatus.choices, # possible states as an array of constants
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue