mirror of
https://github.com/penpot/penpot.git
synced 2025-05-11 17:56:38 +02:00
🐛 Fix sending invitation to existing members
This commit is contained in:
parent
1f9e7f2ae8
commit
4313c45870
2 changed files with 10 additions and 2 deletions
|
@ -729,8 +729,13 @@
|
||||||
(let [perms (get-permissions conn profile-id team-id)
|
(let [perms (get-permissions conn profile-id team-id)
|
||||||
profile (db/get-by-id conn :profile profile-id)
|
profile (db/get-by-id conn :profile profile-id)
|
||||||
team (db/get-by-id conn :team team-id)
|
team (db/get-by-id conn :team team-id)
|
||||||
emails (cond-> (or emails #{}) (string? email) (conj email))]
|
|
||||||
|
|
||||||
|
;; Members emails. We don't re-send inviation to already existing members
|
||||||
|
member? (into #{}
|
||||||
|
(map :email)
|
||||||
|
(db/exec! conn [sql:team-members team-id]))
|
||||||
|
|
||||||
|
emails (cond-> (or emails #{}) (string? email) (conj email))]
|
||||||
|
|
||||||
(run! (partial quotes/check-quote! conn)
|
(run! (partial quotes/check-quote! conn)
|
||||||
(list {::quotes/id ::quotes/invitations-per-team
|
(list {::quotes/id ::quotes/invitations-per-team
|
||||||
|
@ -754,6 +759,7 @@
|
||||||
|
|
||||||
(let [cfg (assoc cfg ::db/conn conn)
|
(let [cfg (assoc cfg ::db/conn conn)
|
||||||
invitations (->> emails
|
invitations (->> emails
|
||||||
|
(remove member?)
|
||||||
(map (fn [email]
|
(map (fn [email]
|
||||||
{:email (str/lower email)
|
{:email (str/lower email)
|
||||||
:team team
|
:team team
|
||||||
|
|
|
@ -177,7 +177,9 @@
|
||||||
:on-submit on-submit}]]
|
:on-submit on-submit}]]
|
||||||
|
|
||||||
[:div.action-buttons
|
[:div.action-buttons
|
||||||
[:& fm/submit-button {:label (tr "modals.invite-member-confirm.accept")}]]]]))
|
[:& fm/submit-button {:label (tr "modals.invite-member-confirm.accept")
|
||||||
|
:disabled (and (boolean (some current-data-emails current-members-emails))
|
||||||
|
(empty? (remove current-members-emails current-data-emails)))}]]]]))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; MEMBERS SECTION
|
;; MEMBERS SECTION
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue