mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Add pending flag to scheduled_notifications.
Set pending flag to false when the notification has been sent to provider task.
This commit is contained in:
@@ -477,6 +477,14 @@ def dao_get_scheduled_notifications():
|
||||
ScheduledNotification
|
||||
).filter(
|
||||
ScheduledNotification.scheduled_for < datetime.utcnow(),
|
||||
Notification.status == NOTIFICATION_CREATED).all()
|
||||
ScheduledNotification.pending).all()
|
||||
|
||||
return notifications
|
||||
|
||||
|
||||
def set_scheduled_notification_to_processed(notification_id):
|
||||
ScheduledNotification.query.filter(
|
||||
ScheduledNotification.notification_id == notification_id
|
||||
).update(
|
||||
{'pending': False}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user