-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#3129 - Domain Renewal Form (Expiring Soon and Expired) - [AD] #3273
Merged
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
d84a789
Renewal form
therealslimhsiehdy b5658a3
Fix linter
therealslimhsiehdy 8b9eb93
added back domain renewal form
asaki222 19e5700
Add in the domain renewal template oops
therealslimhsiehdy e23d81f
added renew method
asaki222 8d8616e
added renewal form
asaki222 a128086
Update print statements and exp timing
therealslimhsiehdy c4b6037
Fix conflict and merge
therealslimhsiehdy c145ecb
put back the fixtures command
asaki222 e5f9696
added tests
asaki222 4feb29b
Add in tests for making edit is clickable and goes to right route
therealslimhsiehdy 3f3ba22
Update text to click on link
therealslimhsiehdy dca70f4
Unit test for submit and recieving error message
therealslimhsiehdy bad8a8c
Fix padding on form and addin subtext for security email
therealslimhsiehdy a3c5004
Removing print statements
therealslimhsiehdy 3dc445d
Update test and add in documentation
therealslimhsiehdy 5f9a398
some test
asaki222 8c44092
created a new test for the submit and ack checkbox
asaki222 f14122d
Merge branch 'main' of https://github.com/cisagov/manage.get.gov into…
asaki222 a8808e5
ran app black
asaki222 26fcf6c
Merge branch 'main' of https://github.com/cisagov/manage.get.gov into…
therealslimhsiehdy b077f81
Address feedback - use form pattern and update error messaging
therealslimhsiehdy e196e02
Address linter errors
therealslimhsiehdy aad1ee9
Fix checkbox unchecked test
therealslimhsiehdy 33e3659
Remove unused import for linter
therealslimhsiehdy 628c4c0
expired domain renewal form
asaki222 99481c9
Merge branch 'main' of https://github.com/cisagov/manage.get.gov into…
asaki222 e8fede7
updated code to fix parsing error
asaki222 c7af664
ran app black .
asaki222 604a956
Merge branch 'rh/3129-domain-renewal-form' of https://github.com/cisa…
asaki222 acd20e8
Fix uncheck error
therealslimhsiehdy fbbdba0
Fix status alert, now show expiring soon checkbox filter etc
therealslimhsiehdy 0148b6c
Fix test
therealslimhsiehdy c9c92e5
Allowing security email to display
therealslimhsiehdy 27dae48
Fix spacing under None provided/Sec email
therealslimhsiehdy 63b3198
Merge branch 'main' of https://github.com/cisagov/manage.get.gov into…
therealslimhsiehdy 0e1d364
If not a domain manager and in non org model mode we should display c…
therealslimhsiehdy d35e09b
Fix linter
therealslimhsiehdy ca0ab8f
updated for pr feedback
asaki222 185c022
fixed conflicts
asaki222 6b2123d
reformatted and updated test
asaki222 6e1b352
Fix your contact info title
therealslimhsiehdy 25ba5b2
Fix test capitalization
therealslimhsiehdy 19114c7
Fix checkbox issue
therealslimhsiehdy 53f48ba
Add in error above ack checkbox and allow edit even after refresh
therealslimhsiehdy 737851d
fixed sidebar issue
asaki222 b47ab07
updated with comment
asaki222 dac673a
Fix wideness of the lines
therealslimhsiehdy 9241790
added exec info true
asaki222 6b1185e
Merge branch 'rh/3129-domain-renewal-form' of https://github.com/cisa…
asaki222 797561d
Remove duplicated function
therealslimhsiehdy c3161ea
Merge branch 'main' of https://github.com/cisagov/manage.get.gov into…
therealslimhsiehdy ef43851
Merge branch 'main' of https://github.com/cisagov/manage.get.gov into…
therealslimhsiehdy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -326,9 +326,8 @@ def renew_domain(self, length: int = 1, unit: epp.Unit = epp.Unit.YEAR): | |
exp_date = self.registry_expiration_date | ||
except KeyError: | ||
# if no expiration date from registry, set it to today | ||
logger.warning("current expiration date not set; setting to today") | ||
logger.warning("current expiration date not set; setting to today", exc_info=True) | ||
exp_date = date.today() | ||
|
||
# create RenewDomain request | ||
request = commands.RenewDomain(name=self.name, cur_exp_date=exp_date, period=epp.Period(length, unit)) | ||
|
||
|
@@ -338,13 +337,14 @@ def renew_domain(self, length: int = 1, unit: epp.Unit = epp.Unit.YEAR): | |
self._cache["ex_date"] = registry.send(request, cleaned=True).res_data[0].ex_date | ||
self.expiration_date = self._cache["ex_date"] | ||
self.save() | ||
|
||
except RegistryError as err: | ||
# if registry error occurs, log the error, and raise it as well | ||
logger.error(f"registry error renewing domain: {err}") | ||
logger.error(f"Registry error renewing domain '{self.name}': {err}") | ||
raise (err) | ||
except Exception as e: | ||
# exception raised during the save to registrar | ||
logger.error(f"error updating expiration date in registrar: {e}") | ||
logger.error(f"Error updating expiration date for domain '{self.name}' in registrar: {e}") | ||
raise (e) | ||
|
||
@Cache | ||
|
@@ -1575,7 +1575,7 @@ def dns_needed(self): | |
logger.info("Changing to DNS_NEEDED state") | ||
logger.info("able to transition to DNS_NEEDED state") | ||
|
||
def get_state_help_text(self) -> str: | ||
def get_state_help_text(self, request=None) -> str: | ||
"""Returns a str containing additional information about a given state. | ||
Returns custom content for when the domain itself is expired.""" | ||
|
||
|
@@ -1585,6 +1585,8 @@ def get_state_help_text(self) -> str: | |
help_text = ( | ||
"This domain has expired, but it is still online. " "To renew this domain, contact [email protected]." | ||
) | ||
elif flag_is_active(request, "domain_renewal") and self.is_expiring(): | ||
help_text = "This domain will expire soon. Contact one of the listed domain managers to renew the domain." | ||
else: | ||
help_text = Domain.State.get_help_text(self.state) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
{% extends "domain_base.html" %} | ||
{% load static url_helpers %} | ||
{% load custom_filters %} | ||
|
||
{% block domain_content %} | ||
{% block breadcrumb %} | ||
|
||
<!-- Banner for if_policy_acknowledged --> | ||
{% if form.is_policy_acknowledged.errors %} | ||
<div class="usa-alert usa-alert--error usa-alert--slim margin-bottom-2"> | ||
<div class="usa-alert__body"> | ||
{% for error in form.is_policy_acknowledged.errors %} | ||
<p class="usa-alert__text">{{ error }}</p> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
{% endif %} | ||
|
||
{% if portfolio %} | ||
<!-- Navigation breadcrumbs --> | ||
<nav class="usa-breadcrumb padding-top-0" aria-label="Domain breadcrumb"> | ||
<ol class="usa-breadcrumb__list"> | ||
<li class="usa-breadcrumb__list-item"> | ||
<a href="{% url 'domains' %}" class="usa-breadcrumb__link"><span>Domains</span></a> | ||
</li> | ||
<li class="usa-breadcrumb__list-item"> | ||
<a href="{% url 'domain' pk=domain.id %}" class="usa-breadcrumb__link"><span>{{domain.name}}</span></a> | ||
</li> | ||
<li class="usa-breadcrumb__list-item usa-current" aria-current="page"> | ||
<span>Renewal Form</span> | ||
</li> | ||
|
||
</ol> | ||
</nav> | ||
{% endif %} | ||
{% endblock breadcrumb %} | ||
|
||
{{ block.super }} | ||
<div class="margin-top-4 tablet:grid-col-10"> | ||
<h2 class="text-bold text-primary-dark domain-name-wrap">Confirm the following information for accuracy</h2> | ||
<p>Review these details below. We <a href="https://get.gov/domains/requirements/#what-.gov-domain-registrants-must-do" class="usa-link"> | ||
require</a> that you maintain accurate information for the domain. | ||
The details you provide will only be used to support the administration of .gov and won't be made public. | ||
</p> | ||
<p>If you would like to retire your domain instead, please <a href="https://get.gov/contact/" class="usa-link"> | ||
contact us</a>. </p> | ||
<p><em>Required fields are marked with an asterisk (<abbr class="usa-hint usa-hint--required" title="required">*</abbr>).</em> | ||
</p> | ||
|
||
|
||
{% url 'user-profile' as url %} | ||
{% include "includes/summary_item.html" with title='Your contact information' value=request.user edit_link=url editable=is_editable contact='true' %} | ||
|
||
{% if analyst_action != 'edit' or analyst_action_location != domain.pk %} | ||
{% if is_portfolio_user and not is_domain_manager %} | ||
<div class="usa-alert usa-alert--info usa-alert--slim"> | ||
<div class="usa-alert__body"> | ||
<p class="usa-alert__text "> | ||
You don't have access to manage {{domain.name}}. If you need to make updates, contact one of the listed domain managers. | ||
</p> | ||
</div> | ||
</div> | ||
{% endif %} | ||
{% endif %} | ||
|
||
{% url 'domain-security-email' pk=domain.id as url %} | ||
{% if security_email is not None and security_email not in hidden_security_emails%} | ||
{% include "includes/summary_item.html" with title='Security email' value=security_email custom_text_for_value_none='We strongly recommend that you provide a security email. This email will allow the public to report observed or suspected security issues on your domain.' edit_link=url editable=is_editable %} | ||
{% else %} | ||
{% include "includes/summary_item.html" with title='Security email' value='None provided' custom_text_for_value_none='We strongly recommend that you provide a security email. This email will allow the public to report observed or suspected security issues on your domain.' edit_link=url editable=is_editable %} | ||
{% endif %} | ||
|
||
{% url 'domain-users' pk=domain.id as url %} | ||
{% if portfolio %} | ||
{% include "includes/summary_item.html" with title='Domain managers' domain_permissions=True value=domain edit_link=url editable=is_editable %} | ||
{% else %} | ||
{% include "includes/summary_item.html" with title='Domain managers' list=True users=True value=domain.permissions.all edit_link=url editable=is_editable %} | ||
{% endif %} | ||
|
||
<div class="border-top-1px border-primary-dark padding-top-1 margin-top-3 margin-bottom-2"> | ||
|
||
<fieldset class="usa-fieldset"> | ||
<legend> | ||
<h3 class="summary-item__title | ||
font-sans-md | ||
text-primary-dark | ||
text-semibold | ||
margin-top-0 | ||
margin-bottom-05 | ||
padding-right-1"> | ||
Acknowledgement of .gov domain requirements </h3> | ||
</legend> | ||
|
||
<form method="post" action="{% url 'domain-renewal' pk=domain.id %}"> | ||
{% csrf_token %} | ||
<div class="usa-checkbox"> | ||
|
||
{% if form.is_policy_acknowledged.errors %} | ||
{% for error in form.is_policy_acknowledged.errors %} | ||
<div class="usa-error-message display-flex" role="alert"> | ||
<svg class="usa-icon usa-icon--large" focusable="true" role="img" aria-label="Error"> | ||
<use xlink:href="{%static 'img/sprite.svg'%}#error"></use> | ||
</svg> | ||
<span class="margin-left-05">{{ error }}</span> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% endif %} | ||
|
||
<input type="hidden" name="is_policy_acknowledged" value="False"> | ||
|
||
<input | ||
class="usa-checkbox__input" | ||
id="renewal-checkbox" | ||
type="checkbox" | ||
name="is_policy_acknowledged" | ||
value="True" | ||
{% if form.is_policy_acknowledged.value %}checked{% endif %} | ||
> | ||
<label class="usa-checkbox__label" for="renewal-checkbox"> | ||
I read and agree to the | ||
<a href="https://get.gov/domains/requirements/" class="usa-link"> | ||
requirements for operating a .gov domain | ||
</a>. | ||
<abbr class="usa-hint usa-hint--required" title="required">*</abbr> | ||
</label> | ||
</div> | ||
|
||
<button | ||
type="submit" | ||
name="submit_button" | ||
value="next" | ||
class="usa-button margin-top-3" | ||
> Submit | ||
</button> | ||
</form> | ||
</fieldset> | ||
</div> <!-- End of the acknowledgement section div --> | ||
</div> | ||
{% endblock %} {# domain_content #} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor changes requested: I see the renew code is logging errors below here but it is not printing the full traceback or the domain that threw the error. Please change both the RegistryError and normal exception to include traceback and domain name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind elaborating or give an example of what you mean by traceback (I'm looking into our code for a pattern, but want to make sure I'm referencing the right area 😅)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh no problem you just want to add exec_info=true on the logger line! docs
example from our code:
logger.warning("Failed to send confirmation email", exc_info=True)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!