Skip to content

Commit

Permalink
fix(1469): handle the situation when all roles failed to grant, no em…
Browse files Browse the repository at this point in the history
…ail should send, refs: #1469
  • Loading branch information
MCatherine1994 committed Aug 14, 2024
1 parent bff7e41 commit 172ae33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions server/admin_management/api/app/integration/gc_notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

GC_NOTIFY_EMAIL_BASE_URL = "https://api.notification.canada.ca"
GC_NOTIFY_GRANT_DELEGATED_ADMIN_EMAIL_TEMPLATE_ID = "9abff613-e507-4562-aae0-008317dfe3b9"
# Template id for granting application admin, we will use this later
GC_NOTIFY_GRANT_APP_ADMIN_EMAIL_TEMPLATE_ID = "230bca59-4906-40b2-8f2b-2f6186a98663"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ def send_email_notification(
)
)

if granted_roles == "": # no role is granted
return

gc_notify_email_service = GCNotifyEmailService()
email_response = gc_notify_email_service.send_delegated_admin_granted_email(
schemas.GCNotifyGrantDelegatedAdminEmailParam(
Expand Down

0 comments on commit 172ae33

Please sign in to comment.