Skip to content

Commit

Permalink
quota: do not complain on no-change of default
Browse files Browse the repository at this point in the history
also no message
  • Loading branch information
bernt-matthias committed Oct 23, 2024
1 parent ed07d87 commit 7876ebe
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 7876ebe

Please sign in to comment.