From e06a45db37f0102b806c10104027ed8f3c75b518 Mon Sep 17 00:00:00 2001 From: M Bernt Date: Thu, 7 Nov 2024 11:21:58 +0100 Subject: [PATCH] Update lib/galaxy/managers/quotas.py --- lib/galaxy/managers/quotas.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/managers/quotas.py b/lib/galaxy/managers/quotas.py index ef38e9fb70df..932e77a91348 100644 --- a/lib/galaxy/managers/quotas.py +++ b/lib/galaxy/managers/quotas.py @@ -153,8 +153,12 @@ def manage_users_and_groups_for_quota(self, quota, params, decode_id=None) -> Op raise ActionInputError("One or more invalid group id has been provided.") self.quota_agent.set_entity_quota_associations(quotas=[quota], users=in_users, groups=in_groups) self.sa_session.refresh(quota) - if len(quota.users) != len(in_users) or len(quota.groups) != len(in_groups): + if len(quota.users) != len(in_users) and len(quota.groups) != len(in_groups): return f"Quota '{quota.name}' has been updated with {len(in_users)} associated users and {len(in_groups)} associated groups." + elif len(quota.users) != len(in_users): + return f"Quota '{quota.name}' has been updated with {len(in_users)} associated users." + elif len(quota.groups) != len(in_groups): + return f"Quota '{quota.name}' has been updated with {len(in_groups)} associated groups." else: return None