Require email address for reporting problems

If you report a problem we want to be able to get back to you to find
out more information, or to update you on the status of a fix. So it
shouldn’t be possible to report a problem without providing an email
address.

This commit makes `email_address` a required field when `ticket_type` is
problem.

This requires a bit of fiddling with the tests which weren’t expecting
to have to provide an email address. So the tests now either:
- pass an email address
- check for an error when they don’t pass an email address
This commit is contained in:
Chris Hill-Scott
2016-12-21 14:55:49 +00:00
parent 5f47ebb8e0
commit d2680fe885
4 changed files with 58 additions and 32 deletions

View File

@@ -403,12 +403,16 @@ class SupportType(Form):
)
class Support(Form):
class Feedback(Form):
name = StringField('Name')
email_address = StringField('Email address')
feedback = TextAreaField('Your message', validators=[DataRequired(message="Cant be empty")])
class Problem(Feedback):
email_address = email_address(label='Email address', gov_user=False)
class Triage(Form):
severe = RadioField(
'Is it an emergency?',