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:
Chris Hill-Scott
2017-07-24 14:55:39 +01:00
parent e2bd2e0439
commit 17a7f5f2c6
3 changed files with 7 additions and 7 deletions

View File

@@ -436,7 +436,7 @@ def delete_service_template(service_id, template_id):
)
except HTTPError as e:
if e.status_code == 404:
message = 'Its never been used.'.format(template['name'])
message = None
else:
raise e

View File

@@ -30,9 +30,11 @@
{% elif template_delete_confirmation_message %}
<div class="bottom-gutter">
{% call banner_wrapper(type='dangerous', subhead=template_delete_confirmation_message[0]) %}
<p>
{{ template_delete_confirmation_message[1] }}
</p>
{% if template_delete_confirmation_message[1] %}
<p>
{{ template_delete_confirmation_message[1] }}
</p>
{% endif %}
<form method='post'>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="submit" class="button" name="delete" value="Confirm" />

View File

@@ -725,9 +725,7 @@ def test_should_show_delete_template_page_with_never_used_block(
_test_page_title=False,
)
assert page.h1.text == 'Are you sure you want to delete Two week reminder?'
assert normalize_spaces(page.select('.banner-dangerous p')[0].text) == (
'Its never been used.'
)
assert not page.select('.banner-dangerous p')
assert normalize_spaces(page.select('.sms-message-wrapper')[0].text) == (
'service one: Template <em>content</em> with & entity'
)