From ed30a85bc8ba660652fae862f8b9dbf463356002 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 3 Dec 2024 12:44:57 -0800 Subject: [PATCH] change create notification to an upsert --- app/dao/notifications_dao.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/dao/notifications_dao.py b/app/dao/notifications_dao.py index cbde45d30..4c40a7e81 100644 --- a/app/dao/notifications_dao.py +++ b/app/dao/notifications_dao.py @@ -71,7 +71,9 @@ def dao_create_notification(notification): # notify-api-742 remove phone numbers from db notification.to = "1" notification.normalised_to = "1" - db.session.add(notification) + + # notify-api-1454 change to an upsert + db.session.merge(notification) def country_records_delivery(phone_prefix):