mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 06:21:50 -05:00
change create notification to an upsert
This commit is contained in:
@@ -73,7 +73,10 @@ def dao_create_notification(notification):
|
||||
notification.normalised_to = "1"
|
||||
|
||||
# notify-api-1454 change to an upsert
|
||||
db.session.merge(notification)
|
||||
stmt = select(Notification).where(Notification.id == notification.id)
|
||||
result = db.session.execute(stmt).scalar()
|
||||
if result is None:
|
||||
db.session.add(notification)
|
||||
|
||||
|
||||
def country_records_delivery(phone_prefix):
|
||||
|
||||
Reference in New Issue
Block a user