mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-16 09:37:03 +02:00
Add logging
This commit is contained in:
parent
1f1a537752
commit
f46988ef67
2 changed files with 46 additions and 41 deletions
|
@ -1162,9 +1162,11 @@ class DomainAdmin(ListHeaderAdmin):
|
||||||
exp_date = date.today()
|
exp_date = date.today()
|
||||||
|
|
||||||
desired_date = date.today() + relativedelta(years=1)
|
desired_date = date.today() + relativedelta(years=1)
|
||||||
month_length = self._month_diff(desired_date, exp_date)
|
logger.info(f"do_extend_expiration_date -> exp {exp_date} des {desired_date}")
|
||||||
|
month_length = self._month_diff(exp_date, desired_date)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
logger.info(f"do_extend_expiration_date -> month length: {month_length}")
|
||||||
obj.renew_domain(length=month_length, unit=epp.Unit.MONTH)
|
obj.renew_domain(length=month_length, unit=epp.Unit.MONTH)
|
||||||
except RegistryError as err:
|
except RegistryError as err:
|
||||||
if err.code:
|
if err.code:
|
||||||
|
@ -1212,6 +1214,7 @@ class DomainAdmin(ListHeaderAdmin):
|
||||||
|
|
||||||
# Grab the delta between the two
|
# Grab the delta between the two
|
||||||
rdelta = relativedelta(end_date, start_date)
|
rdelta = relativedelta(end_date, start_date)
|
||||||
|
logger.info(f"rdelta is: {rdelta}, years {rdelta.years}, months {rdelta.months}")
|
||||||
|
|
||||||
# Calculate total months as years * 12 + months
|
# Calculate total months as years * 12 + months
|
||||||
total_months = rdelta.years * 12 + rdelta.months
|
total_months = rdelta.years * 12 + rdelta.months
|
||||||
|
|
|
@ -13,48 +13,50 @@
|
||||||
>
|
>
|
||||||
Extend expiration date
|
Extend expiration date
|
||||||
</a>
|
</a>
|
||||||
<div
|
{% if original.state != original.State.DELETED %}
|
||||||
class="usa-modal"
|
<div
|
||||||
id="toggle-extend-expiration-alert"
|
class="usa-modal"
|
||||||
aria-labelledby="Are you sure you want to extend this expiration date?"
|
id="toggle-extend-expiration-alert"
|
||||||
aria-describedby="This expiration date will be extended."
|
aria-labelledby="Are you sure you want to extend this expiration date?"
|
||||||
>
|
aria-describedby="This expiration date will be extended."
|
||||||
<div class="usa-modal__content">
|
>
|
||||||
<div class="usa-modal__main">
|
<div class="usa-modal__content">
|
||||||
<h2 class="usa-modal__heading" id="modal-1-heading">
|
<div class="usa-modal__main">
|
||||||
Are you sure you want to extend this expiration date?
|
<h2 class="usa-modal__heading" id="modal-1-heading">
|
||||||
</h2>
|
Are you sure you want to extend this expiration date?
|
||||||
<div class="usa-prose">
|
</h2>
|
||||||
<p id="modal-1-description">
|
<div class="usa-prose">
|
||||||
This action will extend the expiration date by a year.
|
<p id="modal-1-description">
|
||||||
</p>
|
This action will extend the expiration date by a year.
|
||||||
</div>
|
</p>
|
||||||
|
</div>
|
||||||
<div class="usa-modal__footer">
|
|
||||||
<ul class="usa-button-group">
|
<div class="usa-modal__footer">
|
||||||
<li class="usa-button-group__item">
|
<ul class="usa-button-group">
|
||||||
<button
|
<li class="usa-button-group__item">
|
||||||
id="extend_expiration_date_button"
|
<button
|
||||||
type="submit"
|
id="extend_expiration_date_button"
|
||||||
class="usa-button"
|
type="submit"
|
||||||
name="_extend_expiration_date"
|
class="usa-button"
|
||||||
>
|
name="_extend_expiration_date"
|
||||||
Confirm
|
>
|
||||||
</button>
|
Confirm
|
||||||
</li>
|
</button>
|
||||||
<li class="usa-button-group__item">
|
</li>
|
||||||
<button
|
<li class="usa-button-group__item">
|
||||||
type="button"
|
<button
|
||||||
class="usa-button usa-button--unstyled padding-105 text-center"
|
type="button"
|
||||||
data-close-modal
|
class="usa-button usa-button--unstyled padding-105 text-center"
|
||||||
>
|
data-close-modal
|
||||||
Cancel
|
>
|
||||||
</button>
|
Cancel
|
||||||
</li>
|
</button>
|
||||||
</ul>
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{% endif %}
|
||||||
{# {% include 'includes/modal.html' with modal_heading="Are you sure you want to extend this expiration date?" modal_button=modal_button|safe %} #}
|
{# {% include 'includes/modal.html' with modal_heading="Are you sure you want to extend this expiration date?" modal_button=modal_button|safe %} #}
|
||||||
</div>
|
</div>
|
||||||
<div class="spacer"></div>
|
<div class="spacer"></div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue