This commit is contained in:
Rachid Mrad 2024-06-26 17:03:39 -04:00
parent 0fecc199d0
commit 56a8f83e18
No known key found for this signature in database
3 changed files with 615 additions and 581 deletions

View file

@ -151,6 +151,11 @@ class Domain(TimeStampedModel, DomainHelper):
# previously existed but has been deleted from the registry
DELETED = "deleted", "Deleted"
@classmethod
def get_state_label(cls, state: str):
"""Returns the associated label for a given state value"""
return cls(state).label if state else None
@classmethod
def get_help_text(cls, state) -> str:
"""Returns a help message for a desired state. If none is found, an empty string is returned"""