getter from registry also updates registrar

This commit is contained in:
David Kennedy 2023-11-17 07:37:31 -05:00
parent 7ec6072a92
commit 7b6929c176
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B

View file

@ -211,8 +211,16 @@ class Domain(TimeStampedModel, DomainHelper):
@Cache @Cache
def registry_expiration_date(self) -> date: def registry_expiration_date(self) -> date:
"""Get or set the `ex_date` element from the registry.""" """Get or set the `ex_date` element from the registry.
return self._get_property("ex_date") 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 @registry_expiration_date.setter # type: ignore
def registry_expiration_date(self, ex_date: date): def registry_expiration_date(self, ex_date: date):