Skip to content

Commit

Permalink
Fix SA2.0 (query->select) in galaxy.quota
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Aug 7, 2023
1 parent 805441c commit dce5ab7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/galaxy/quota/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
from typing import Optional

from sqlalchemy import select
from sqlalchemy.sql import text

import galaxy.util
Expand Down Expand Up @@ -209,11 +210,10 @@ def set_default_quota(self, default_type, quota):
self.sa_session.delete(gqa)
# Find the old default, assign the new quota if it exists
label = quota.quota_source_label
dqas = (
self.sa_session.query(self.model.DefaultQuotaAssociation)
.filter(self.model.DefaultQuotaAssociation.table.c.type == default_type)
.all()
stmt = select(self.model.DefaultQuotaAssociation).filter(
self.model.DefaultQuotaAssociation.type == default_type
)
dqas = self.sa_session.scalars(stmt).all()
target_default = None
for dqa in dqas:
if dqa.quota.quota_source_label == label and not dqa.quota.deleted:
Expand Down

0 comments on commit dce5ab7

Please sign in to comment.