Fix bug with reply to email addresses

https://www.pivotaltracker.com/story/show/180026726

There was a bug where if you enter an invalid email address in
to the edit reply to email address form and click save, the
form you get shown with your error message will always contain
the field to set as default the reply to and also delete. This should
not have been the case. If you make an error on the form when
changing a reply to that is already a default, then you should not
be given the chance to change it to not default, nor should you
be able to delete it.

This commit fixes that bug by making sure the additional form fields
are only shown if the reply to being changed is not the default.
This commit is contained in:
David McDonald
2021-11-04 11:21:58 +00:00
parent 1c2b65356f
commit b4b124d681
3 changed files with 67 additions and 2 deletions
@@ -23,7 +23,7 @@
},
error_message_with_html=True
) }}
{% if form.is_default.data %}
{% if not show_choice_of_default_checkbox %}
<p class="form-group">
This is the default reply-to address for {{ current_service.name }} emails
</p>