mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-31 09:43:54 +02:00
updated error messages in security email and nameserver; updated modal in dnssec ds data
This commit is contained in:
parent
464279bf33
commit
a737f26c50
4 changed files with 18 additions and 15 deletions
|
@ -10,6 +10,8 @@ from registrar.utility.errors import (
|
||||||
NameserverErrorCodes as nsErrorCodes,
|
NameserverErrorCodes as nsErrorCodes,
|
||||||
DsDataError,
|
DsDataError,
|
||||||
DsDataErrorCodes,
|
DsDataErrorCodes,
|
||||||
|
SecurityEmailError,
|
||||||
|
SecurityEmailErrorCodes,
|
||||||
)
|
)
|
||||||
|
|
||||||
from ..models import Contact, DomainInformation, Domain
|
from ..models import Contact, DomainInformation, Domain
|
||||||
|
@ -156,7 +158,13 @@ class ContactForm(forms.ModelForm):
|
||||||
class DomainSecurityEmailForm(forms.Form):
|
class DomainSecurityEmailForm(forms.Form):
|
||||||
"""Form for adding or editing a security email to a domain."""
|
"""Form for adding or editing a security email to a domain."""
|
||||||
|
|
||||||
security_email = forms.EmailField(label="Security email", required=False)
|
security_email = forms.EmailField(
|
||||||
|
label="Security email",
|
||||||
|
required=False,
|
||||||
|
error_messages={
|
||||||
|
'invalid': str(SecurityEmailError(code=SecurityEmailErrorCodes.BAD_DATA)),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class DomainOrgNameAddressForm(forms.ModelForm):
|
class DomainOrgNameAddressForm(forms.ModelForm):
|
||||||
|
@ -237,7 +245,7 @@ class DomainDsdataForm(forms.Form):
|
||||||
Tests that string matches all hexadecimal values.
|
Tests that string matches all hexadecimal values.
|
||||||
|
|
||||||
Raise validation error to display error in form
|
Raise validation error to display error in form
|
||||||
if invalid caracters entered
|
if invalid characters entered
|
||||||
"""
|
"""
|
||||||
if not re.match(r"^[0-9a-fA-F]+$", value):
|
if not re.match(r"^[0-9a-fA-F]+$", value):
|
||||||
raise forms.ValidationError(str(DsDataError(code=DsDataErrorCodes.INVALID_DIGEST_CHARS)))
|
raise forms.ValidationError(str(DsDataError(code=DsDataErrorCodes.INVALID_DIGEST_CHARS)))
|
||||||
|
|
|
@ -114,7 +114,7 @@
|
||||||
aria-describedby="Your DNSSEC records will be deleted from the registry."
|
aria-describedby="Your DNSSEC records will be deleted from the registry."
|
||||||
data-force-action
|
data-force-action
|
||||||
>
|
>
|
||||||
{% include 'includes/modal.html' with cancel_button_resets_ds_form=True modal_heading="Warning: You are about to delete all DS records on your domain" modal_description="To fully disable DNSSEC: In addition to deleting your DS records here you’ll also need to delete the DS records at your DNS host. To avoid causing your domain to appear offline you should wait to delete your DS records at your DNS host until the Time to Live (TTL) expires. This is often less than 24 hours, but confirm with your provider." modal_button=modal_button|safe %}
|
{% include 'includes/modal.html' with cancel_button_resets_ds_form=True modal_heading="Warning: You are about to remove all DS records on your domain" modal_description="To fully disable DNSSEC: In addition to removing your DS records here you’ll also need to delete the DS records at your DNS host. To avoid causing your domain to appear offline you should wait to delete your DS records at your DNS host until the Time to Live (TTL) expires. This is often less than 24 hours, but confirm with your provider." modal_button=modal_button|safe %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %} {# domain_content #}
|
{% endblock %} {# domain_content #}
|
||||||
|
|
|
@ -66,20 +66,18 @@ class NameserverErrorCodes(IntEnum):
|
||||||
value but is not a subdomain
|
value but is not a subdomain
|
||||||
- 3 INVALID_IP invalid ip address format or invalid version
|
- 3 INVALID_IP invalid ip address format or invalid version
|
||||||
- 4 TOO_MANY_HOSTS more than the max allowed host values
|
- 4 TOO_MANY_HOSTS more than the max allowed host values
|
||||||
- 5 UNABLE_TO_UPDATE_DOMAIN unable to update the domain
|
- 5 MISSING_HOST host is missing for a nameserver
|
||||||
- 6 MISSING_HOST host is missing for a nameserver
|
- 6 INVALID_HOST host is invalid for a nameserver
|
||||||
- 7 INVALID_HOST host is invalid for a nameserver
|
- 7 BAD_DATA bad data input for nameserver
|
||||||
- 8 BAD_DATA bad data input for nameserver
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
MISSING_IP = 1
|
MISSING_IP = 1
|
||||||
GLUE_RECORD_NOT_ALLOWED = 2
|
GLUE_RECORD_NOT_ALLOWED = 2
|
||||||
INVALID_IP = 3
|
INVALID_IP = 3
|
||||||
TOO_MANY_HOSTS = 4
|
TOO_MANY_HOSTS = 4
|
||||||
UNABLE_TO_UPDATE_DOMAIN = 5
|
MISSING_HOST = 5
|
||||||
MISSING_HOST = 6
|
INVALID_HOST = 6
|
||||||
INVALID_HOST = 7
|
BAD_DATA = 7
|
||||||
BAD_DATA = 8
|
|
||||||
|
|
||||||
|
|
||||||
class NameserverError(Exception):
|
class NameserverError(Exception):
|
||||||
|
@ -93,9 +91,6 @@ class NameserverError(Exception):
|
||||||
NameserverErrorCodes.GLUE_RECORD_NOT_ALLOWED: ("Name server address does not match domain name"),
|
NameserverErrorCodes.GLUE_RECORD_NOT_ALLOWED: ("Name server address does not match domain name"),
|
||||||
NameserverErrorCodes.INVALID_IP: ("{}: Enter an IP address in the required format."),
|
NameserverErrorCodes.INVALID_IP: ("{}: Enter an IP address in the required format."),
|
||||||
NameserverErrorCodes.TOO_MANY_HOSTS: ("Too many hosts provided, you may not have more than 13 nameservers."),
|
NameserverErrorCodes.TOO_MANY_HOSTS: ("Too many hosts provided, you may not have more than 13 nameservers."),
|
||||||
NameserverErrorCodes.UNABLE_TO_UPDATE_DOMAIN: (
|
|
||||||
"Unable to update domain, changes were not applied. Check logs as a Registry Error is the likely cause"
|
|
||||||
),
|
|
||||||
NameserverErrorCodes.MISSING_HOST: ("Name server must be provided to enter IP address."),
|
NameserverErrorCodes.MISSING_HOST: ("Name server must be provided to enter IP address."),
|
||||||
NameserverErrorCodes.INVALID_HOST: ("Enter a name server in the required format, like ns1.example.com"),
|
NameserverErrorCodes.INVALID_HOST: ("Enter a name server in the required format, like ns1.example.com"),
|
||||||
NameserverErrorCodes.BAD_DATA: (
|
NameserverErrorCodes.BAD_DATA: (
|
||||||
|
|
|
@ -308,7 +308,7 @@ class DomainNameserversView(DomainFormBaseView):
|
||||||
except NameserverError as Err:
|
except NameserverError as Err:
|
||||||
# NamserverErrors *should* be caught in form; if reached here,
|
# NamserverErrors *should* be caught in form; if reached here,
|
||||||
# there was an uncaught error in submission (through EPP)
|
# there was an uncaught error in submission (through EPP)
|
||||||
messages.error(self.request, NameserverError(code=nsErrorCodes.UNABLE_TO_UPDATE_DOMAIN))
|
messages.error(self.request, NameserverError(code=nsErrorCodes.BAD_DATA))
|
||||||
logger.error(f"Nameservers error: {Err}")
|
logger.error(f"Nameservers error: {Err}")
|
||||||
# TODO: registry is not throwing an error when no connection
|
# TODO: registry is not throwing an error when no connection
|
||||||
except RegistryError as Err:
|
except RegistryError as Err:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue