mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 18:56:15 +02:00
getter from registry also updates registrar
This commit is contained in:
parent
7ec6072a92
commit
7b6929c176
1 changed files with 10 additions and 2 deletions
|
@ -211,8 +211,16 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
|
||||
@Cache
|
||||
def registry_expiration_date(self) -> date:
|
||||
"""Get or set the `ex_date` element from the registry."""
|
||||
return self._get_property("ex_date")
|
||||
"""Get or set the `ex_date` element from the registry.
|
||||
Additionally, update the expiration date in the registrar"""
|
||||
try:
|
||||
self.expiration_date = self._get_property("ex_date")
|
||||
self.save()
|
||||
return self.expiration_date
|
||||
except Exception as e:
|
||||
# exception raised during the save to registrar
|
||||
logger.error(f"error updating expiration date in registrar: {e}")
|
||||
raise (e)
|
||||
|
||||
@registry_expiration_date.setter # type: ignore
|
||||
def registry_expiration_date(self, ex_date: date):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue