Skip to content

Commit

Permalink
Update epoch_notification_persistence.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Aymanhki authored Apr 9, 2024
1 parent b54d1f0 commit 66de6a6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def get_user_notifications(self, user_id: int, limit: int, offset: int):
conn = get_db_connection()
curr = conn.cursor()

curr.execute("SELECT * FROM notifications WHERE user_id = %s ORDER BY created_at DESC LIMIT %s OFFSET %s", (user_id, limit, offset))
curr.execute("SELECT * FROM notifications WHERE user_id = %s AND created_at > now() ORDER BY created_at DESC LIMIT %s OFFSET %s", (user_id, limit, offset))
notifs = curr.fetchall()

for i in range(len(notifs)):
Expand Down

0 comments on commit 66de6a6

Please sign in to comment.