Skip to content

Commit

Permalink
Update lib/galaxy/managers/quotas.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias authored Nov 7, 2024
1 parent 436e8e4 commit e06a45d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/galaxy/managers/quotas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e06a45d

Please sign in to comment.