Skip to content

Commit dce5ab7

Browse files
committed
Fix SA2.0 (query->select) in galaxy.quota
1 parent 805441c commit dce5ab7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/galaxy/quota/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import logging
33
from typing import Optional
44

5+
from sqlalchemy import select
56
from sqlalchemy.sql import text
67

78
import galaxy.util
@@ -209,11 +210,10 @@ def set_default_quota(self, default_type, quota):
209210
self.sa_session.delete(gqa)
210211
# Find the old default, assign the new quota if it exists
211212
label = quota.quota_source_label
212-
dqas = (
213-
self.sa_session.query(self.model.DefaultQuotaAssociation)
214-
.filter(self.model.DefaultQuotaAssociation.table.c.type == default_type)
215-
.all()
213+
stmt = select(self.model.DefaultQuotaAssociation).filter(
214+
self.model.DefaultQuotaAssociation.type == default_type
216215
)
216+
dqas = self.sa_session.scalars(stmt).all()
217217
target_default = None
218218
for dqa in dqas:
219219
if dqa.quota.quota_source_label == label and not dqa.quota.deleted:

0 commit comments

Comments
 (0)