diff --git a/backend/api/views.py b/backend/api/views.py index 43f5c10ee1..275328a1f6 100644 --- a/backend/api/views.py +++ b/backend/api/views.py @@ -183,7 +183,27 @@ def access_and_submission_check(user, data): return {"report_id": sac.report_id, "next": "TBD"} - return {"errors": serializer.errors} + return { + "errors": serializer.errors, + "certifying_auditee_contact_fullname": data.get( + "certifying_auditee_contact_fullname" + ), + "certifying_auditee_contact_email": data.get( + "certifying_auditee_contact_email" + ), + "certifying_auditee_contact_re_email": data.get( + "certifying_auditee_contact_re_email" + ), + "certifying_auditor_contact_fullname": data.get( + "certifying_auditor_contact_fullname" + ), + "certifying_auditor_contact_email": data.get( + "certifying_auditor_contact_email" + ), + "certifying_auditor_contact_re_email": data.get( + "certifying_auditor_contact_re_email" + ), + } class Sprite(generic.View): diff --git a/backend/audit/templates/audit/manage-submission-change-access.html b/backend/audit/templates/audit/manage-submission-change-access.html index 61216e7ddc..ad07e07967 100644 --- a/backend/audit/templates/audit/manage-submission-change-access.html +++ b/backend/audit/templates/audit/manage-submission-change-access.html @@ -31,23 +31,26 @@

Add Audit Editor

For the changes to take effect, users must log out and log back in to their account.

{% endif %} - -
- {% if errors %} - + There were errors when attempting to submit the form. Scroll down for more details. {% endif %} - + +
+ - - + + + placeholder="[email address]" + value="{{ email }}"/> + {{ errors.email }} * Indicates a required field.

+ {% if errors %} + There were errors when attempting to submit the form. Scroll down for more details. + {% endif %}
@@ -46,7 +49,8 @@ aria-required="true" required data-validate-not-null="" - data-validate-length="<= 100 >= 2"/> + data-validate-length="<= 100 >= 2" + value="{{ certifying_auditee_contact_fullname | default_if_none:'' }}" />
@@ -74,7 +78,8 @@ data-validate-not-null="" data-validate-email="" data-validate-must-not-match="certifying_auditor_contact_email" - data-validate-length="<= 340 >= 6"/> + data-validate-length="<= 340 >= 6" + value="{{ certifying_auditee_contact_email | default_if_none:'' }}" />
@@ -95,10 +100,14 @@ aria-required="true" required data-validate-must-match="certifying_auditee_contact_email" - data-validate-length="<= 340 >= 6"/> + data-validate-length="<= 340 >= 6" + value="{{ certifying_auditee_contact_re_email | default_if_none:'' }}" />
+ {% if errors.certifying_auditee_contact_email %} + Enter a valid email address. + {% endif %}
@@ -130,7 +139,8 @@ aria-required="true" required data-validate-not-null="" - data-validate-length="<= 100 >= 2"/> + data-validate-length="<= 100 >= 2" + value="{{ certifying_auditor_contact_fullname | default_if_none:'' }}" />
@@ -158,7 +168,8 @@ data-validate-not-null="" data-validate-email="" data-validate-must-not-match="certifying_auditee_contact_email" - data-validate-length="<= 340 >= 6"/> + data-validate-length="<= 340 >= 6" + value="{{ certifying_auditor_contact_email | default_if_none:'' }}" />
@@ -179,13 +190,17 @@ aria-required="true" required data-validate-must-match="certifying_auditor_contact_email" - data-validate-length="<= 340 >= 6"/> + data-validate-length="<= 340 >= 6" + value="{{ certifying_auditor_contact_re_email | default_if_none:'' }}" />
+ {% if errors.certifying_auditor_contact_email %} + Enter a valid email address. + {% endif %} - +
@@ -255,6 +270,9 @@ + {% if errors.auditee_contacts_email %} + Enter a valid email address. + {% endif %}