From 6ff553b96d4977852c14bfe5f7f29988c5effb82 Mon Sep 17 00:00:00 2001 From: Alex Manning Date: Fri, 12 May 2023 12:15:41 +0100 Subject: [PATCH] Handle notifications to shared users better. --- .../jasmin_notifications/mail/grant_created/content.txt | 2 +- .../jasmin_notifications/mail/grant_expired/content.txt | 2 +- .../jasmin_notifications/mail/grant_expiring/content.txt | 2 +- .../jasmin_notifications/mail/grant_revoked/content.txt | 2 +- .../jasmin_notifications/mail/request_confirm/content.txt | 2 +- .../jasmin_notifications/mail/request_incomplete/content.txt | 2 +- .../jasmin_notifications/mail/request_rejected/content.txt | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/jasmin_services/templates/jasmin_notifications/mail/grant_created/content.txt b/jasmin_services/templates/jasmin_notifications/mail/grant_created/content.txt index c6eb1f2..11df795 100644 --- a/jasmin_services/templates/jasmin_notifications/mail/grant_created/content.txt +++ b/jasmin_services/templates/jasmin_notifications/mail/grant_created/content.txt @@ -2,7 +2,7 @@ {% block content %} Hi {{ user.first_name }}, -{% if target.access.user.user_type == "SERVICE" %} +{% if (target.access.user.user_type == "SERVICE" or (target.access.user.user_type == "SHARED") %} The following access has been granted: Service: {{ target.access.role.service }} diff --git a/jasmin_services/templates/jasmin_notifications/mail/grant_expired/content.txt b/jasmin_services/templates/jasmin_notifications/mail/grant_expired/content.txt index 15a3c60..8221872 100644 --- a/jasmin_services/templates/jasmin_notifications/mail/grant_expired/content.txt +++ b/jasmin_services/templates/jasmin_notifications/mail/grant_expired/content.txt @@ -4,7 +4,7 @@ Hi {{ user.first_name }}, The following access has expired: -{% if target.access.user.user_type == "SERVICE" %} +{% if (target.access.user.user_type == "SERVICE" or (target.access.user.user_type == "SHARED") %} Service: {{ target.access.role.service }} Role: {{ target.access.role.name }} User: {{ target.access.user }} diff --git a/jasmin_services/templates/jasmin_notifications/mail/grant_expiring/content.txt b/jasmin_services/templates/jasmin_notifications/mail/grant_expiring/content.txt index 83ee55e..ce668bb 100644 --- a/jasmin_services/templates/jasmin_notifications/mail/grant_expiring/content.txt +++ b/jasmin_services/templates/jasmin_notifications/mail/grant_expiring/content.txt @@ -4,7 +4,7 @@ Hi {{ user.first_name }}, The following access will expire soon: -{% if target.access.user.user_type == "SERVICE" %} +{% if (target.access.user.user_type == "SERVICE" or (target.access.user.user_type == "SHARED") %} Service: {{ target.access.role.service }} Role: {{ target.access.role.name }} User: {{ target.access.user }} diff --git a/jasmin_services/templates/jasmin_notifications/mail/grant_revoked/content.txt b/jasmin_services/templates/jasmin_notifications/mail/grant_revoked/content.txt index 85c4332..0df5ff2 100644 --- a/jasmin_services/templates/jasmin_notifications/mail/grant_revoked/content.txt +++ b/jasmin_services/templates/jasmin_notifications/mail/grant_revoked/content.txt @@ -4,7 +4,7 @@ Hi {{ user.first_name }}, The following access has been revoked: -{% if target.access.user.user_type == "SERVICE" %} +{% if (target.access.user.user_type == "SERVICE" or (target.access.user.user_type == "SHARED") %} Service: {{ target.access.role.service }} Role: {{ target.access.role.name }} User: {{ target.access.user }} diff --git a/jasmin_services/templates/jasmin_notifications/mail/request_confirm/content.txt b/jasmin_services/templates/jasmin_notifications/mail/request_confirm/content.txt index 0b93166..b6fa499 100644 --- a/jasmin_services/templates/jasmin_notifications/mail/request_confirm/content.txt +++ b/jasmin_services/templates/jasmin_notifications/mail/request_confirm/content.txt @@ -4,7 +4,7 @@ Hi {{ user.first_name }}, The following request has been submitted for approval: -{% if target.access.user.user_type == "SERVICE" %} +{% if (target.access.user.user_type == "SERVICE" or (target.access.user.user_type == "SHARED") %} Service: {{ target.access.role.service }} Role: {{ target.access.role.name }} User: {{ target.access.user }} diff --git a/jasmin_services/templates/jasmin_notifications/mail/request_incomplete/content.txt b/jasmin_services/templates/jasmin_notifications/mail/request_incomplete/content.txt index 3397a6d..6765b38 100644 --- a/jasmin_services/templates/jasmin_notifications/mail/request_incomplete/content.txt +++ b/jasmin_services/templates/jasmin_notifications/mail/request_incomplete/content.txt @@ -4,7 +4,7 @@ Hi {{ user.first_name }}, The following request requires additional information: -{% if target.access.user.user_type == "SERVICE" %} +{% if (target.access.user.user_type == "SERVICE" or (target.access.user.user_type == "SHARED") %} Service: {{ target.access.role.service }} Role: {{ target.access.role.name }} User: {{ target.access.user }} diff --git a/jasmin_services/templates/jasmin_notifications/mail/request_rejected/content.txt b/jasmin_services/templates/jasmin_notifications/mail/request_rejected/content.txt index ae0e025..42d15d3 100644 --- a/jasmin_services/templates/jasmin_notifications/mail/request_rejected/content.txt +++ b/jasmin_services/templates/jasmin_notifications/mail/request_rejected/content.txt @@ -4,7 +4,7 @@ Hi {{ user.first_name }}, The following request has been rejected: -{% if target.access.user.user_type == "SERVICE" %} +{% if (target.access.user.user_type == "SERVICE" or (target.access.user.user_type == "SHARED") %} Service: {{ target.access.role.service }} Role: {{ target.access.role.name }} User: {{ target.access.user }}