Change years to int

Temp changes because I cant pass in months specifically
This commit is contained in:
zandercymatics 2024-02-07 16:02:57 -07:00
parent 7b878c2195
commit 8700a05fbf
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 43 additions and 43 deletions

View file

@ -1174,7 +1174,7 @@ class DomainAdmin(ListHeaderAdmin):
logger.info(f"do_extend_expiration_date -> month length: {month_length}")
# TODO why cant I specify months
#obj.renew_domain(length=month_length, unit=epp.Unit.MONTH)
years = month_length/12
years = int(month_length/12)
if years >= 1:
obj.renew_domain(length=month_length/12)
else:

View file

@ -6,6 +6,7 @@
<input id="manageDomainSubmitButton" type="submit" value="Manage domain" name="_edit_domain">
<input type="submit" value="Get registry status" name="_get_status">
{{ modal_button }}
{% if original.state != original.State.DELETED %}
<a
href="#toggle-extend-expiration-alert"
aria-controls="toggle-extend-expiration-alert"
@ -13,50 +14,49 @@
>
Extend expiration date
</a>
{% if original.state != original.State.DELETED %}
<div
class="usa-modal"
id="toggle-extend-expiration-alert"
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">
<h2 class="usa-modal__heading" id="modal-1-heading">
Are you sure you want to extend this expiration date?
</h2>
<div class="usa-prose">
<p id="modal-1-description">
This action will extend the expiration date by a year.
</p>
</div>
<div class="usa-modal__footer">
<ul class="usa-button-group">
<li class="usa-button-group__item">
<button
id="extend_expiration_date_button"
type="submit"
class="usa-button"
name="_extend_expiration_date"
>
Confirm
</button>
</li>
<li class="usa-button-group__item">
<button
type="button"
class="usa-button usa-button--unstyled padding-105 text-center"
data-close-modal
>
Cancel
</button>
</li>
</ul>
</div>
<div
class="usa-modal"
id="toggle-extend-expiration-alert"
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">
<h2 class="usa-modal__heading" id="modal-1-heading">
Are you sure you want to extend this expiration date?
</h2>
<div class="usa-prose">
<p id="modal-1-description">
This action will extend the expiration date by a year.
</p>
</div>
<div class="usa-modal__footer">
<ul class="usa-button-group">
<li class="usa-button-group__item">
<button
id="extend_expiration_date_button"
type="submit"
class="usa-button"
name="_extend_expiration_date"
>
Confirm
</button>
</li>
<li class="usa-button-group__item">
<button
type="button"
class="usa-button usa-button--unstyled padding-105 text-center"
data-close-modal
>
Cancel
</button>
</li>
</ul>
</div>
</div>
{% endif %}
</div>
{% endif %}
{# {% include 'includes/modal.html' with modal_heading="Are you sure you want to extend this expiration date?" modal_button=modal_button|safe %} #}
</div>
<div class="spacer"></div>