mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-24 16:23:44 -04:00
fix another
This commit is contained in:
@@ -67,7 +67,7 @@ def get_services_by_partial_name(service_name):
|
|||||||
service_name = escape_special_characters(service_name)
|
service_name = escape_special_characters(service_name)
|
||||||
stmt = select(Service).where(Service.name.ilike("%{}%".format(service_name)))
|
stmt = select(Service).where(Service.name.ilike("%{}%".format(service_name)))
|
||||||
result = db.session.execute(stmt)
|
result = db.session.execute(stmt)
|
||||||
return result.scalars.all()
|
return result.scalars().all()
|
||||||
|
|
||||||
|
|
||||||
def dao_count_live_services():
|
def dao_count_live_services():
|
||||||
@@ -191,14 +191,18 @@ def dao_fetch_service_by_id(service_id, only_active=False):
|
|||||||
|
|
||||||
|
|
||||||
def dao_fetch_service_by_inbound_number(number):
|
def dao_fetch_service_by_inbound_number(number):
|
||||||
inbound_number = InboundNumber.query.filter(
|
stmt = select(InboundNumber).where(
|
||||||
InboundNumber.number == number, InboundNumber.active
|
InboundNumber.number == number, InboundNumber.active
|
||||||
).first()
|
)
|
||||||
|
result = db.session.execute(stmt)
|
||||||
|
inbound_number = result.scalars().first()
|
||||||
|
|
||||||
if not inbound_number:
|
if not inbound_number:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return Service.query.filter(Service.id == inbound_number.service_id).first()
|
stmt = select(Service).where(Service.id == inbound_number.service_id)
|
||||||
|
result = db.session.execute(stmt)
|
||||||
|
return result.scalars().first()
|
||||||
|
|
||||||
|
|
||||||
def dao_fetch_service_by_id_with_api_keys(service_id, only_active=False):
|
def dao_fetch_service_by_id_with_api_keys(service_id, only_active=False):
|
||||||
|
|||||||
Reference in New Issue
Block a user