From 4c6747ab35b68fca884dbd31bf2f374bd7d103b8 Mon Sep 17 00:00:00 2001 From: Ilya Y <75578537+ilya-bkv@users.noreply.github.com> Date: Mon, 16 Oct 2023 19:00:30 +0300 Subject: [PATCH] undefined check in unseen notification update (#94) Co-authored-by: Igor Lobanov --- services/notifications/notification_service.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/notifications/notification_service.py b/services/notifications/notification_service.py index f7078b95..7e92aa95 100644 --- a/services/notifications/notification_service.py +++ b/services/notifications/notification_service.py @@ -32,6 +32,9 @@ def update_prev_notification(notification, user, reaction): notification_data["users"] = [u for u in notification_data["users"] if u['id'] != user.id] notification_data["users"].append(user_to_user_data(user)) + + if notification_data["reactionIds"] is None: + notification_data["reactionIds"] = [] notification_data["reactionIds"].append(reaction.id) notification.data = json.dumps(notification_data, ensure_ascii=False)