🐛 Fix bad check on leave nitrate org

This commit is contained in:
Pablo Alba 2026-04-17 11:36:39 +02:00
parent 32d9688c3c
commit bf8fa087ad

View File

@ -108,17 +108,6 @@
valid-teams-to-leave-ids (into valid-teams-to-transfer-ids valid-teams-to-exit-ids)
;; Get all the teams ids
all-teams-ids (into #{} d/xf:map-id (:teams org-summary))
;; Get all the ids of the teams that will be processed:
;; all the ids on teams-to-leave, teams-to-delete and default-team-id
selected-team-ids (-> (into #{default-team-id} teams-to-delete)
(into d/xf:map-id teams-to-leave))
;; Check that we are processing all the teams
all-teams-selected? (= all-teams-ids selected-team-ids)
default-team-files-count (-> (db/exec-one! conn [sql:get-team-files-count default-team-id])
:total)
delete-default-team? (= default-team-files-count 0)
@ -146,8 +135,7 @@
(when (or
(not valid-teams-to-delete?)
(not valid-teams-to-leave?)
(not valid-default-team-id?)
(not all-teams-selected?))
(not valid-default-team-id?))
(ex/raise :type :validation
:code :not-valid-teams))