From c83fbd4c7da94425e54326b0c66dec177b3b5eb9 Mon Sep 17 00:00:00 2001 From: Ian McEwen Date: Tue, 23 Jul 2024 12:18:35 -0700 Subject: [PATCH] CORE-2004: filter the list of members by existence in iRODS rather than erroring --- src/data_info/services/groups.clj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/data_info/services/groups.clj b/src/data_info/services/groups.clj index b25f017..7f78081 100644 --- a/src/data_info/services/groups.clj +++ b/src/data_info/services/groups.clj @@ -36,9 +36,11 @@ (validators/user-exists cm user) (validators/user-is-group-admin cm user) (validators/group-exists cm group-name) - (validators/all-users-exist cm members) + ;; instead of this, we filter the list by extant users, so the group can + ;; still be updated if a few don't exist in irods + ;(validators/all-users-exist cm members) (let [current-members (set (users/list-group-members cm group-name)) - desired-members (set (map di-users/ensure-qualified members)) + desired-members (set (map di-users/ensure-qualified (filter users/user-exists? members))) members-to-add (cset/difference desired-members current-members) members-to-remove (cset/difference current-members desired-members)