From d683263b87a57abca4d931a0f3d789d23755d781 Mon Sep 17 00:00:00 2001 From: Alex Manning Date: Wed, 3 May 2023 11:06:36 +0100 Subject: [PATCH] Service_user is no longer an attribute of user. --- jasmin_services/models/behaviours/mail.py | 2 +- .../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 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/jasmin_services/models/behaviours/mail.py b/jasmin_services/models/behaviours/mail.py index 2fa9859..7c432b1 100644 --- a/jasmin_services/models/behaviours/mail.py +++ b/jasmin_services/models/behaviours/mail.py @@ -25,7 +25,7 @@ class Meta: def apply(self, user, _role): # Don't join service users up to the mailing list - if user.service_user: + if user.user_type in ["SERVICE", "SHARED", "TRAINING"]: return # If the user is already in joined_users, there is nothing to do if self.joined_users.filter(pk=user.pk).exists(): 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 ba7cc94..c6eb1f2 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.service_user %} +{% if target.access.user.user_type == "SERVICE" %} 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 744d902..15a3c60 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.service_user %} +{% if target.access.user.user_type == "SERVICE" %} 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 fa8761c..83ee55e 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.service_user %} +{% if target.access.user.user_type == "SERVICE" %} 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 5455ed7..85c4332 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.service_user %} +{% if target.access.user.user_type == "SERVICE" %} 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 f78fd89..0b93166 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.service_user %} +{% if target.access.user.user_type == "SERVICE" %} 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 8870b58..3397a6d 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.service_user %} +{% if target.access.user.user_type == "SERVICE" %} 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 9c7b30e..ae0e025 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.service_user %} +{% if target.access.user.user_type == "SERVICE" %} Service: {{ target.access.role.service }} Role: {{ target.access.role.name }} User: {{ target.access.user }}