Skip to content

Commit

Permalink
Fix SQL error when dismissing notification
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-uva committed Dec 22, 2022
1 parent 83b7570 commit cfc5b91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion webtool/lib/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def dismiss_notification(self, notification_id):
:param int notification_id: ID of the notification to dismiss
"""
self.db.execute("DELETE FROM users_notifications WHERE id IN ( SELECT n.id FROM users_notifications AS n, users AS u "
"WHERE u.name = %s AND n.id = %s"
"WHERE u.name = %s AND n.id = %s "
"AND (u.name = n.username OR (u.is_admin AND n.username = '!admins') OR n.username = '!everyone'))", (self.get_id(), notification_id))

def get_notifications(self):
Expand Down

0 comments on commit cfc5b91

Please sign in to comment.