mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-05 02:41:14 -05:00
fix another
This commit is contained in:
@@ -71,11 +71,11 @@ def get_services_by_partial_name(service_name):
|
|||||||
|
|
||||||
|
|
||||||
def dao_count_live_services():
|
def dao_count_live_services():
|
||||||
return Service.query.filter_by(
|
stmt = select(Service).where(
|
||||||
active=True,
|
Service.active, Service.count_as_live, Service.restricted is False
|
||||||
restricted=False,
|
)
|
||||||
count_as_live=True,
|
result = db.session.execute(stmt)
|
||||||
).count()
|
return result.scalars().count()
|
||||||
|
|
||||||
|
|
||||||
def dao_fetch_live_services_data():
|
def dao_fetch_live_services_data():
|
||||||
@@ -228,11 +228,11 @@ def dao_fetch_all_services_by_user(user_id, only_active=False):
|
|||||||
|
|
||||||
|
|
||||||
def dao_fetch_all_services_created_by_user(user_id):
|
def dao_fetch_all_services_created_by_user(user_id):
|
||||||
query = Service.query.filter_by(created_by_id=user_id).order_by(
|
stmt = (
|
||||||
asc(Service.created_at)
|
select(Service).where(created_by_id=user_id).order_by(asc(Service.created_at))
|
||||||
)
|
)
|
||||||
|
result = db.session.execute(stmt)
|
||||||
return query.all()
|
return result.scalars.all()
|
||||||
|
|
||||||
|
|
||||||
@autocommit
|
@autocommit
|
||||||
|
|||||||
Reference in New Issue
Block a user