mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 18:01:08 -05:00
Update notification status by message reference
- SES sends a reference to allow us to identify the notification - use this to update status If source of email is one of our internal emails (invites or validations) - don't try and update a notification.
This commit is contained in:
@@ -80,20 +80,9 @@ def update_notification_status_by_id(notification_id, status):
|
||||
return count
|
||||
|
||||
|
||||
def update_notification_status_by_to(to, status):
|
||||
count = db.session.query(Notification).filter_by(
|
||||
to=to
|
||||
).update({
|
||||
Notification.status: status,
|
||||
Notification.updated_at: datetime.utcnow()
|
||||
})
|
||||
db.session.commit()
|
||||
return count
|
||||
|
||||
|
||||
def update_notification_status_by_reference(reference, status):
|
||||
count = db.session.query(Notification).filter_by(
|
||||
refernce=reference
|
||||
reference=reference
|
||||
).update({
|
||||
Notification.status: status,
|
||||
Notification.updated_at: datetime.utcnow()
|
||||
|
||||
Reference in New Issue
Block a user