diff --git a/app/dao/notifications_dao.py b/app/dao/notifications_dao.py index 4c40a7e81..d231ece42 100644 --- a/app/dao/notifications_dao.py +++ b/app/dao/notifications_dao.py @@ -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):