mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
initial
This commit is contained in:
@@ -51,14 +51,22 @@ from app.utils import (
|
||||
|
||||
|
||||
def dao_fetch_all_services(only_active=False):
|
||||
query = Service.query.order_by(asc(Service.created_at)).options(
|
||||
joinedload(Service.users)
|
||||
|
||||
stmt = (
|
||||
select(Service)
|
||||
.order_by(asc(Service.created_at))
|
||||
.options(joinedload(Service.users))
|
||||
)
|
||||
|
||||
if only_active:
|
||||
query = query.filter(Service.active)
|
||||
|
||||
return query.all()
|
||||
stmt = (
|
||||
select(Service)
|
||||
.where(Service.active is True)
|
||||
.order_by(asc(Service.created_at))
|
||||
.options(joinedload(Service.users))
|
||||
)
|
||||
if only_active:
|
||||
stmt = stmt.filter(Service.active)
|
||||
return db.session.execute(stmt).scalars().all()
|
||||
|
||||
|
||||
def get_services_by_partial_name(service_name):
|
||||
|
||||
@@ -86,7 +86,7 @@ def _create_service_invite(invited_user, invite_link_host):
|
||||
redis_store.set(
|
||||
f"email-personalisation-{saved_notification.id}",
|
||||
json.dumps(personalisation),
|
||||
ex=2*24*60*60,
|
||||
ex=2 * 24 * 60 * 60,
|
||||
)
|
||||
send_notification_to_queue(saved_notification, queue=QueueNames.NOTIFY)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user