diff --git a/src/registrar/forms/domain.py b/src/registrar/forms/domain.py index 303c43690..a8a285e99 100644 --- a/src/registrar/forms/domain.py +++ b/src/registrar/forms/domain.py @@ -55,7 +55,7 @@ class DomainNameserverForm(forms.Form): server = forms.CharField(label="Name server", strip=True) ip = IPAddressField( - label="IP address", + label="IP Address (IPv4 or IPv6)", strip=True, required=False, # validators=[ @@ -75,7 +75,7 @@ class DomainNameserverForm(forms.Form): ip_list = [ip.strip() for ip in ip.split(",")] if not server and len(ip_list) > 0: # If 'server' is empty, disallow 'ip' input - self.add_error('server', "Nameserver must be provided to enter IP address.") + self.add_error('server', "Name server must be provided to enter IP address.") # if there's a nameserver and an ip, validate nameserver/ip combo diff --git a/src/registrar/templates/domain_nameservers.html b/src/registrar/templates/domain_nameservers.html index aa53719ea..e4323615a 100644 --- a/src/registrar/templates/domain_nameservers.html +++ b/src/registrar/templates/domain_nameservers.html @@ -11,8 +11,16 @@

DNS name servers

-

Before your domain can be used we'll need information about your domain - name servers.

+

Before your domain can be used we’ll need information about your domain name servers. Name server records indicate which DNS server is authoritative for your domain.

+ +

Add a name server record by entering the address (e.g., ns1.nameserver.com) in the name server fields below. You may add up to 13 name servers.

+ +
+
+

Add an IP address only when your name server's address includes your domain name (e.g., if your domain name is "example.gov" and your name server is "ns1.example.gov,” then an IP address is required.) To add multiple IP addresses, separate them with commas.

+

This step is uncommon unless you self-host your DNS or use custom addresses for your nameserver.

+
+
{% include "includes/required_fields.html" %} @@ -36,7 +44,7 @@ {% endwith %}
- {% with sublabel_text="Example: ns"|concat:forloop.counter|concat:".example.com" add_group_class="usa-form-group--unstyled-error" %} + {% with sublabel_text="Ex: 86.124.49.54 or 2001:db8::1234:5678" %} {% input_with_errors form.ip %} {% endwith %}
@@ -44,7 +52,7 @@ {% endfor %} - +
+ +
{% endblock %} {# domain_content #} diff --git a/src/registrar/templates/includes/form_messages.html b/src/registrar/templates/includes/form_messages.html index c7b704f67..e2888e4ee 100644 --- a/src/registrar/templates/includes/form_messages.html +++ b/src/registrar/templates/includes/form_messages.html @@ -1,6 +1,6 @@ {% if messages %} {% for message in messages %} -
+
{{ message }}
diff --git a/src/registrar/views/domain.py b/src/registrar/views/domain.py index 06361a3b3..23306bda9 100644 --- a/src/registrar/views/domain.py +++ b/src/registrar/views/domain.py @@ -255,7 +255,6 @@ class DomainNameserversView(DomainFormBaseView, BaseFormSet): for i, form in enumerate(formset): # form = self.get_form(self, **kwargs) form.fields["server"].label += f" {i+1}" - form.fields["ip"].label += f" {i+1}" if i < 2: form.fields["server"].required = True else: @@ -270,11 +269,15 @@ class DomainNameserversView(DomainFormBaseView, BaseFormSet): This post method harmonizes using DomainBaseView and FormMixin """ self._get_domain(request) - form = self.get_form() - if form.is_valid(): - return self.form_valid(form) + formset = self.get_form() + + if "btn-cancel-click" in request.POST: + return redirect("/", {"formset": formset}, RequestContext(request)) + + if formset.is_valid(): + return self.form_valid(formset) else: - return self.form_invalid(form) + return self.form_invalid(formset) def form_valid(self, formset): """The formset is valid, perform something with it.""" @@ -320,7 +323,7 @@ class DomainNameserversView(DomainFormBaseView, BaseFormSet): logger.error(f"Registry error: {Err}") else: messages.success( - self.request, "The name servers for this domain have been updated." + self.request, "The name servers for this domain have been updated. Keep in mind that DNS changes may take some time to propagate across the internet. It can take anywhere from a few minutes to 48 hours for your changes to take place." ) # superclass has the redirect