Merge pull request #3049 from GSA/3012-one-off-button-is-missing-for-users-with-only-send-message-permission

Bug Fix: One-off button is missing for users with ‘send message' permission
This commit is contained in:
ccostino
2025-10-24 12:21:37 -04:00
committed by GitHub
2 changed files with 7 additions and 4 deletions

View File

@@ -846,9 +846,7 @@ def get_skip_link(step_index, template):
and step_index == 0
and template.template_type in ("sms", "email")
and not (template.template_type == "sms" and current_user.mobile_number is None)
and current_user.has_permissions(
ServicePermission.MANAGE_TEMPLATES, ServicePermission.MANAGE_SERVICE
)
and current_user.has_permissions(ServicePermission.SEND_MESSAGES)
):
return (
"Use my {}".format(first_column_headings[template.template_type][0]),

View File

@@ -1310,7 +1310,12 @@ def test_send_one_off_shows_placeholders_in_correct_order(
"Use my email address",
partial(url_for, "main.send_one_off_to_myself"),
),
(create_active_caseworking_user(), "sms", None, None),
(
create_active_caseworking_user(),
"sms",
"Use my phone number",
partial(url_for, "main.send_one_off_to_myself"),
),
],
)
def test_send_one_off_has_skip_link(