mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-15 17:17:02 +02:00
Better logging
This commit is contained in:
parent
aff6aad1d4
commit
8d476d5a80
2 changed files with 4 additions and 6 deletions
|
@ -1147,15 +1147,12 @@ class DomainAdmin(ListHeaderAdmin):
|
|||
|
||||
def do_extend_expiration_date(self, request, obj):
|
||||
if not isinstance(obj, Domain):
|
||||
# Could be problematic if the type is similar,
|
||||
# but not the same (same field/func names).
|
||||
# We do not want to accidentally delete records.
|
||||
self.message_user(request, "Object is not of type Domain", messages.ERROR)
|
||||
return None
|
||||
|
||||
try:
|
||||
obj.renew_domain(date_to_extend=date.today())
|
||||
except Exception as err:
|
||||
except RegistryError as err:
|
||||
if err.code:
|
||||
self.message_user(
|
||||
request,
|
||||
|
@ -1169,7 +1166,8 @@ class DomainAdmin(ListHeaderAdmin):
|
|||
messages.ERROR,
|
||||
)
|
||||
else:
|
||||
# all other type error messages, display the error
|
||||
self.message_user(request, err, messages.ERROR)
|
||||
except Exception as err:
|
||||
self.message_user(request, err, messages.ERROR)
|
||||
else:
|
||||
updated_domain = Domain.objects.filter(id=obj).get()
|
||||
|
|
|
@ -255,7 +255,7 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
# if no expiration date from registry, set it to today
|
||||
logger.warning("current expiration date not set; setting to today")
|
||||
date_to_extend = date.today()
|
||||
|
||||
print(f"This is the date to extend: {date_to_extend} vs registry {self.registry_expiration_date}")
|
||||
# create RenewDomain request
|
||||
request = commands.RenewDomain(name=self.name, cur_exp_date=date_to_extend, period=epp.Period(length, unit))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue