Hide ‘Use my email address/phone number link’

This link is useful for people who are setting up templates and want to
test out how they look/how Notify works.

‘Caseworker’ users shouldn’t need to send themselves messages on a
regular basis, so this link is another thing we can take away.
This commit is contained in:
Chris Hill-Scott
2018-06-14 15:04:01 +01:00
parent 883f51b823
commit 0018ecd765
2 changed files with 25 additions and 9 deletions

View File

@@ -436,7 +436,8 @@ def send_test_step(service_id, template_id, step_index):
request.endpoint == 'main.send_one_off_step' and
step_index == 0 and
template.template_type != 'letter' and
not (template.template_type == 'sms' and current_user.mobile_number is None)
not (template.template_type == 'sms' and current_user.mobile_number is None) and
current_user.has_permissions('view_activity')
):
skip_link = (
'Use my {}'.format(first_column_headings[template.template_type][0]),