mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-25 12:08:40 +02:00
Respond to PR feedback
This commit is contained in:
parent
eda5e9751b
commit
6fd29aea75
6 changed files with 91 additions and 6 deletions
|
@ -36,7 +36,12 @@ class Domain(TimeStampedModel):
|
|||
]
|
||||
|
||||
class Status(models.TextChoices):
|
||||
"""The status codes we can receive from the registry."""
|
||||
"""
|
||||
The status codes we can receive from the registry.
|
||||
|
||||
These are detailed in RFC 5731 in section 2.3.
|
||||
https://www.rfc-editor.org/std/std69.txt
|
||||
"""
|
||||
|
||||
# Requests to delete the object MUST be rejected.
|
||||
CLIENT_DELETE_PROHIBITED = "clientDeleteProhibited"
|
||||
|
@ -96,7 +101,9 @@ class Domain(TimeStampedModel):
|
|||
|
||||
@classmethod
|
||||
def available(cls, domain: str) -> bool:
|
||||
"""Check if a domain is available. Not implemented."""
|
||||
"""Check if a domain is available.
|
||||
|
||||
Not implemented. Returns a dummy value for testing."""
|
||||
return domain_check(domain)
|
||||
|
||||
def transfer(self):
|
||||
|
@ -119,9 +126,15 @@ class Domain(TimeStampedModel):
|
|||
logger.error(e)
|
||||
# TODO: back off error handling
|
||||
return None
|
||||
if hasattr(self, "info") and (property in self.info):
|
||||
return self.info[property]
|
||||
if hasattr(self, "info"):
|
||||
if property in self.info:
|
||||
return self.info[property]
|
||||
else:
|
||||
raise KeyError(
|
||||
"Requested key %s was not found in registry data." % str(property)
|
||||
)
|
||||
else:
|
||||
# TODO: return an error if registry cannot be contacted
|
||||
return None
|
||||
|
||||
def could_be_domain(self) -> bool:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue