diff --git a/src/registrar/forms/application_wizard.py b/src/registrar/forms/application_wizard.py index c28e46162..5c9236b0a 100644 --- a/src/registrar/forms/application_wizard.py +++ b/src/registrar/forms/application_wizard.py @@ -736,8 +736,9 @@ class NoOtherContactsForm(RegistrarForm): required=True, # label has to end in a space to get the label_suffix to show label=( - "Please explain why there are no other employees from your organization " - "we can contact to help us assess your eligibility for a .gov domain." + "You don't need to provide names of other employees now, but it may " + "slow down our assessment of your eligibility. Describe why there are " + "no other employees who can help verify your request." ), widget=forms.Textarea(), validators=[ diff --git a/src/registrar/templates/application_other_contacts.html b/src/registrar/templates/application_other_contacts.html index 7a901dfc5..f7d783a30 100644 --- a/src/registrar/templates/application_other_contacts.html +++ b/src/registrar/templates/application_other_contacts.html @@ -13,15 +13,25 @@ {% endblock %} {% block form_required_fields_help_text %} -{% include "includes/required_fields.html" %} +{# commenting out to remove this block from this point in the page #} {% endblock %} {% block form_fields %} - {{ forms.0 }} - {# forms.0 is a small yes/no form that toggles the visibility of "other contact" formset #} +
+ +

Are there other employees who can help verify your request?

+
+ + {% with add_class="usa-radio__input--tile" add_legend_class="usa-sr-only" %} + {% input_with_errors forms.0.has_other_contacts %} + {% endwith %} + {# forms.0 is a small yes/no form that toggles the visibility of "other contact" formset #} + +
+ {% include "includes/required_fields.html" %} {{ forms.1.management_form }} {# forms.1 is a formset and this iterates over its forms #} {% for form in forms.1.forms %} @@ -59,6 +69,10 @@
+
+ +

No other employees from your organization?

+
{% with attr_maxlength=1000 %} {% input_with_errors forms.2.no_other_contacts_rationale %} {% endwith %} diff --git a/src/registrar/views/application.py b/src/registrar/views/application.py index 68e476ebf..c183457b5 100644 --- a/src/registrar/views/application.py +++ b/src/registrar/views/application.py @@ -385,6 +385,7 @@ class ApplicationWizard(ApplicationWizardPermissionView, TemplateView): # always save progress self.save(forms) else: + logger.info("all forms are not valid") context = self.get_context_data() context["forms"] = forms return render(request, self.template_name, context) @@ -501,26 +502,22 @@ class OtherContacts(ApplicationWizard): # test for has_contacts if other_contacts_yes_no_form.cleaned_data.get('has_other_contacts'): logger.info("has other contacts") - # remove data from no_other_contacts_form and set - # form to always_valid + # mark the no_other_contacts_form for deletion no_other_contacts_form.mark_form_for_deletion() # test that the other_contacts_forms and no_other_contacts_forms are valid all_forms_valid = all(form.is_valid() for form in forms[1:]) else: logger.info("has no other contacts") - # remove data from each other_contacts_form + # mark the other_contacts_forms formset for deletion other_contacts_forms.mark_formset_for_deletion() - # set the delete data to on in each form - # Create a mutable copy of the QueryDict - # mutable_data = QueryDict(mutable=True) - # mutable_data.update(self.request.POST.copy()) - - # for i, form in enumerate(other_contacts_forms.forms): - # form_prefix = f'other_contacts-{i}' - # mutable_data[f'{form_prefix}-deleted'] = 'on' - # other_contacts_forms.forms[i].data = mutable_data.copy() all_forms_valid = all(form.is_valid() for form in forms[1:]) else: + logger.info("yes no form is invalid") + # if yes no form is invalid, no choice has been made + # mark other forms for deletion so that their errors are not + # returned + other_contacts_forms.mark_formset_for_deletion() + no_other_contacts_form.mark_form_for_deletion() all_forms_valid = False return all_forms_valid