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:
Rebecca Law
2017-05-22 15:07:16 +01:00
parent a57dc18895
commit 9bfba52f53
7 changed files with 38 additions and 4 deletions

View File

@@ -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}
)