mirror of
https://github.com/penpot/penpot.git
synced 2025-06-26 18:07:02 +02:00
🐛 Avoid exception on insert duplicates on user invitations.
This commit is contained in:
parent
1467fd5dbf
commit
e240525a35
1 changed files with 5 additions and 2 deletions
|
@ -92,7 +92,10 @@
|
||||||
:profile-id member-id}
|
:profile-id member-id}
|
||||||
(teams/role->params role))
|
(teams/role->params role))
|
||||||
claims (assoc claims :state :created)]
|
claims (assoc claims :state :created)]
|
||||||
(db/insert! conn :team-profile-rel params)
|
|
||||||
|
(db/insert! conn :team-profile-rel params
|
||||||
|
{:on-conflict-do-nothing true})
|
||||||
|
|
||||||
(if (and (uuid? profile-id)
|
(if (and (uuid? profile-id)
|
||||||
(= member-id profile-id))
|
(= member-id profile-id))
|
||||||
;; If the current session is already matches the invited
|
;; If the current session is already matches the invited
|
||||||
|
@ -114,7 +117,7 @@
|
||||||
(assoc response
|
(assoc response
|
||||||
:cookies (session/cookies session {:value id}))))})))
|
:cookies (session/cookies session {:value id}))))})))
|
||||||
|
|
||||||
;; In this case, we waint until frontend app redirect user to
|
;; In this case, we wait until frontend app redirect user to
|
||||||
;; registeration page, the user is correctly registered and the
|
;; registeration page, the user is correctly registered and the
|
||||||
;; register mutation call us again with the same token to finally
|
;; register mutation call us again with the same token to finally
|
||||||
;; create the corresponding team-profile relation from the first
|
;; create the corresponding team-profile relation from the first
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue