Skip to content

Commit

Permalink
Merge pull request #19045 from bernt-matthias/quota/default-noop
Browse files Browse the repository at this point in the history
[24.1] quota: do not complain on no-change of default
  • Loading branch information
jdavcs authored Dec 19, 2024
2 parents 3a195be + 7876ebe commit 8aefad4
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions lib/galaxy/managers/quotas.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,27 +184,25 @@ def set_quota_default(self, quota, params) -> str:
if params.default != "no":
self.quota_agent.set_default_quota(params.default, quota)
message = f"Quota '{quota.name}' is now the default for {params.default} users."
elif quota.default:
message = f"Quota '{quota.name}' is no longer the default for {quota.default[0].type} users."
for dqa in quota.default:
self.sa_session.delete(dqa)
with transaction(self.sa_session):
self.sa_session.commit()
else:
if quota.default:
message = f"Quota '{quota.name}' is no longer the default for {quota.default[0].type} users."
for dqa in quota.default:
self.sa_session.delete(dqa)
with transaction(self.sa_session):
self.sa_session.commit()
else:
message = f"Quota '{quota.name}' is not a default."
message = ""
return message

def unset_quota_default(self, quota, params=None) -> str:
if not quota.default:
raise ActionInputError(f"Quota '{quota.name}' is not a default.")
else:
message = ""
if quota.default:
message = f"Quota '{quota.name}' is no longer the default for {quota.default[0].type} users."
for dqa in quota.default:
self.sa_session.delete(dqa)
with transaction(self.sa_session):
self.sa_session.commit()
return message
return message

def delete_quota(self, quota, params=None) -> str:
quotas = util.listify(quota)
Expand Down

0 comments on commit 8aefad4

Please sign in to comment.