Skip to content

Commit

Permalink
check if notification already exists to prevent duplicate insert atte…
Browse files Browse the repository at this point in the history
…mpts
  • Loading branch information
Kenneth Kehl committed Dec 2, 2024
1 parent f3e412f commit 661ef10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/dao/notifications_dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def dao_create_notification(notification):
notification.to = "1"
notification.normalised_to = "1"

stmt = select(Notification).where(id=notification.id)
stmt = select(Notification).where(Notification.id == notification.id)
result = db.session.execute(stmt).scalar()
if result is None:
db.session.add(notification)
Expand Down

0 comments on commit 661ef10

Please sign in to comment.