mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-15 17:17:02 +02:00
Temp changes
This commit is contained in:
parent
6c909dcc64
commit
7b878c2195
1 changed files with 12 additions and 1 deletions
|
@ -1166,12 +1166,23 @@ class DomainAdmin(ListHeaderAdmin):
|
|||
|
||||
# Get the difference in months between the expiration date, and the
|
||||
# desired date (today + 1). Then, add one year to that.
|
||||
# TODO - error: Periods for domain registrations must be specified in years.???
|
||||
one_year = 12
|
||||
month_length = self._month_diff(exp_date, desired_date) + one_year
|
||||
|
||||
try:
|
||||
logger.info(f"do_extend_expiration_date -> month length: {month_length}")
|
||||
obj.renew_domain(length=month_length, unit=epp.Unit.MONTH)
|
||||
# TODO why cant I specify months
|
||||
#obj.renew_domain(length=month_length, unit=epp.Unit.MONTH)
|
||||
years = month_length/12
|
||||
if years >= 1:
|
||||
obj.renew_domain(length=month_length/12)
|
||||
else:
|
||||
self.message_user(
|
||||
request,
|
||||
f"Error extending this domain: Can't extend date by 0 years.",
|
||||
messages.ERROR,
|
||||
)
|
||||
except RegistryError as err:
|
||||
if err.code:
|
||||
self.message_user(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue