From 96071604b93b62ee96c11d7b64d7f18333b12470 Mon Sep 17 00:00:00 2001 From: Joonas Syysvirta Date: Tue, 12 Nov 2024 13:05:30 +0200 Subject: [PATCH] Securitas Flow: Use reservation email address When creating the access grants for Securitas Flow, user the email address from the reservation first and fall back to the user's email address if the reservation doesn't have the reserver email address specified (i.e. it's not asked in the reservation form). Refs TTVA-214 --- kulkunen/drivers/securitas.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kulkunen/drivers/securitas.py b/kulkunen/drivers/securitas.py index 911fa14de..7c4e33ccb 100644 --- a/kulkunen/drivers/securitas.py +++ b/kulkunen/drivers/securitas.py @@ -43,6 +43,7 @@ def install_grant(self, grant): assert grant.state == grant.INSTALLING user = grant.reservation.user + email = grant.reservation.reserver_email_address or user.email user_id = str(user.pk) @@ -65,7 +66,7 @@ def install_grant(self, grant): "userExtId": user_id, "firstName": user.first_name, "lastName": user.last_name, - "email": user.email, + "email": email, "notifyUser": True, **params, },