Add security email view

This commit is contained in:
igorkorenfeld 2022-11-08 14:52:34 -05:00
parent 0b67dcc25e
commit 281cff4131
No known key found for this signature in database
GPG key ID: 826947A4B867F659
2 changed files with 29 additions and 0 deletions

View file

@ -122,6 +122,11 @@ class OtherContactsForm(forms.Form):
email = forms.EmailField(label="Email")
phone = forms.CharField(label="Phone")
class SecurityEmailForm(forms.Form):
email = forms.EmailField(
required=False,
label="Email",
)
# List of forms in our wizard. Each entry is a tuple of a name and a form
# subclass
@ -134,6 +139,7 @@ FORMS = [
("purpose", PurposeForm),
("your_contact", YourContactForm),
("other_contacts", OtherContactsForm),
("security_email", SecurityEmailForm),
]
# Dict to match up the right template with the right step. Keys here must
@ -147,6 +153,7 @@ TEMPLATES = {
"purpose": "application_purpose.html",
"your_contact": "application_your_contact.html",
"other_contacts": "application_other_contacts.html",
"security_email": "application_security_email.html",
}
# We need to pass our page titles as context to the templates, indexed
@ -160,6 +167,7 @@ TITLES = {
"purpose": "Purpose of your domain",
"your_contact": "Your contact information",
"other_contacts": "Other contacts for your domain",
"security_email": "Security email for public use",
}

View file

@ -0,0 +1,21 @@
<!-- Test page -->
{% extends 'application_form.html' %}
{% load widget_tweaks %}
{% load static %}
{% block form_content %}
<p id="instructions"> 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. <strong> Security emails are made public.</strong> We recommend using an alias, like security@&lt;domain.gov&gt;.</p>
<form class="usa-form usa-form--large" id="step__{{wizard.steps.current}}" method="post">
{{ wizard.management_form }}
{% csrf_token %}
{{ wizard.form.email|add_label_class:"usa-label" }}
{{ wizard.form.email|add_class:"usa-input"|attr:"aria-describedby:instructions" }}
{{ block.super }}
</form>
{% endblock %}