Skip to content

Commit

Permalink
Fix SQLAlchemy error by using ids not mapped instances
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenwardy committed Jul 4, 2024
1 parent f81b752 commit 6a64f3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def add_notification(target, causer: User, type: NotificationType, title: str, u

if target.rank.at_least(UserRank.NEW_MEMBER) and target != causer:
session.query(Notification) \
.filter_by(user=target, causer=causer, type=type, title=title, url=url, package=package) \
.filter_by(user_id=target.id, causer_id=causer.id, type=type, title=title, url=url, package_id=package.id) \
.delete()
notif = Notification(target, causer, type, title, url, package)
session.add(notif)
Expand Down

0 comments on commit 6a64f3f

Please sign in to comment.