mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Different back links and form actions on verify page depending if add or change
This commit is contained in:
@@ -443,6 +443,7 @@ def service_verify_reply_to_address(service_id, notification_id):
|
||||
notification_id=notification_id,
|
||||
partials=get_service_verify_reply_to_address_partials(service_id, notification_id),
|
||||
verb=("Change" if replace else "Add"),
|
||||
replace=replace,
|
||||
request_args=request_args
|
||||
)
|
||||
|
||||
@@ -458,12 +459,12 @@ def get_service_verify_reply_to_address_partials(service_id, notification_id):
|
||||
form = ServiceReplyToEmailForm()
|
||||
first_email_address = current_service.count_email_reply_to_addresses == 0
|
||||
notification = notification_api_client.get_notification(current_app.config["NOTIFY_SERVICE_ID"], notification_id)
|
||||
replace = request.args.get('replace', False)
|
||||
verification_status = "pending"
|
||||
is_default = True if (request.args.get('is_default', False) == "True") else False
|
||||
if notification["status"] == "delivered":
|
||||
verification_status = "success"
|
||||
if notification["to"] not in [i["email_address"] for i in current_service.email_reply_to_addresses]:
|
||||
replace = request.args.get('replace', False)
|
||||
if replace and replace != "False":
|
||||
service_api_client.update_reply_to_email_address(
|
||||
current_service.id, replace, email_address=notification["to"], is_default=is_default
|
||||
@@ -491,7 +492,8 @@ def get_service_verify_reply_to_address_partials(service_id, notification_id):
|
||||
verification_status=verification_status,
|
||||
is_default=is_default,
|
||||
form=form,
|
||||
first_email_address=first_email_address
|
||||
first_email_address=first_email_address,
|
||||
replace=replace
|
||||
),
|
||||
'stop': 0 if verification_status == "pending" else 1
|
||||
}
|
||||
|
||||
@@ -40,8 +40,13 @@
|
||||
<p>
|
||||
Do not use your own email address for replies.
|
||||
</p>
|
||||
{% if replace %}
|
||||
{% set form_url = url_for('.service_edit_email_reply_to', service_id=service_id, reply_to_email_id=replace) %}
|
||||
{% else %}
|
||||
{% set form_url = url_for('.service_add_email_reply_to', service_id=service_id) %}
|
||||
{% endif %}
|
||||
{% call form_wrapper(
|
||||
action = url_for('.service_add_email_reply_to', service_id=service_id)
|
||||
action = form_url
|
||||
) %}
|
||||
{{ textbox(
|
||||
form.email_address,
|
||||
|
||||
@@ -11,10 +11,14 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
{% if replace %}
|
||||
{% set back_link_href = url_for('.service_edit_email_reply_to', service_id=service_id, reply_to_email_id=replace) %}
|
||||
{% else %}
|
||||
{% set back_link_href = url_for('.service_add_email_reply_to', service_id=service_id) %}
|
||||
{% endif %}
|
||||
{{ page_header(
|
||||
'{} email reply-to address'.format(verb),
|
||||
back_link=url_for('main.service_add_email_reply_to', service_id=current_service.id)
|
||||
back_link=back_link_href
|
||||
) }}
|
||||
{{ ajax_block(
|
||||
partials,
|
||||
|
||||
Reference in New Issue
Block a user