From 52444c5783e3c88d0e0b5eabb020ed8206e6b576 Mon Sep 17 00:00:00 2001
From: Dimitra Chatzichrysou <dimitra.chatzichrysou@cern.ch>
Date: Fri, 18 Jun 2021 18:34:56 +0200
Subject: [PATCH] [Fix] Add missing user_id in delete_user_feed_notifications

---
 .../data_source/postgres/postgres_data_source.py                 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/notifications_routing/data_source/postgres/postgres_data_source.py b/notifications_routing/data_source/postgres/postgres_data_source.py
index d115de9..48b8bed 100644
--- a/notifications_routing/data_source/postgres/postgres_data_source.py
+++ b/notifications_routing/data_source/postgres/postgres_data_source.py
@@ -255,6 +255,7 @@ class PostgresDataSource(DataSource):
         """Delete user feed notifications."""
         with self.session() as session:
             user_feed_notifications = session.query(UserFeedNotification).filter(
+                UserFeedNotification.userId == user_id,
                 UserFeedNotification.frequencyType == frequency_type,
                 UserFeedNotification.creationDatetime <= runtime_datetime,
                 UserFeedNotification.deliveryTime == runtime_time,
-- 
GitLab