Skip to content

Commit

Permalink
Securitas Flow: Use reservation email address
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jopesy committed Nov 12, 2024
1 parent 692873e commit 9607160
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kulkunen/drivers/securitas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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,
},
Expand Down

0 comments on commit 9607160

Please sign in to comment.