mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 23:55:58 -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"
|
notification.normalised_to = "1"
|
||||||
|
|
||||||
# notify-api-1454 change to an upsert
|
# 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):
|
def country_records_delivery(phone_prefix):
|
||||||
|
|||||||
Reference in New Issue
Block a user