mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-05 16:18:26 -04:00
Remove last used message if key’s never been used
I don’t think it adds anything to tell you that a key’s never been used. The value of the ‘key was used 3 minutes ago’ message is in stopping you accidentally revoking something you shouldn’t have.
This commit is contained in:
@@ -436,7 +436,7 @@ def delete_service_template(service_id, template_id):
|
|||||||
)
|
)
|
||||||
except HTTPError as e:
|
except HTTPError as e:
|
||||||
if e.status_code == 404:
|
if e.status_code == 404:
|
||||||
message = 'It’s never been used.'.format(template['name'])
|
message = None
|
||||||
else:
|
else:
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
|||||||
@@ -30,9 +30,11 @@
|
|||||||
{% elif template_delete_confirmation_message %}
|
{% elif template_delete_confirmation_message %}
|
||||||
<div class="bottom-gutter">
|
<div class="bottom-gutter">
|
||||||
{% call banner_wrapper(type='dangerous', subhead=template_delete_confirmation_message[0]) %}
|
{% call banner_wrapper(type='dangerous', subhead=template_delete_confirmation_message[0]) %}
|
||||||
<p>
|
{% if template_delete_confirmation_message[1] %}
|
||||||
{{ template_delete_confirmation_message[1] }}
|
<p>
|
||||||
</p>
|
{{ template_delete_confirmation_message[1] }}
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
<form method='post'>
|
<form method='post'>
|
||||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||||
<input type="submit" class="button" name="delete" value="Confirm" />
|
<input type="submit" class="button" name="delete" value="Confirm" />
|
||||||
|
|||||||
@@ -725,9 +725,7 @@ def test_should_show_delete_template_page_with_never_used_block(
|
|||||||
_test_page_title=False,
|
_test_page_title=False,
|
||||||
)
|
)
|
||||||
assert page.h1.text == 'Are you sure you want to delete Two week reminder?'
|
assert page.h1.text == 'Are you sure you want to delete Two week reminder?'
|
||||||
assert normalize_spaces(page.select('.banner-dangerous p')[0].text) == (
|
assert not page.select('.banner-dangerous p')
|
||||||
'It’s never been used.'
|
|
||||||
)
|
|
||||||
assert normalize_spaces(page.select('.sms-message-wrapper')[0].text) == (
|
assert normalize_spaces(page.select('.sms-message-wrapper')[0].text) == (
|
||||||
'service one: Template <em>content</em> with & entity'
|
'service one: Template <em>content</em> with & entity'
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user