Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
devketanpro committed Jul 9, 2024
1 parent 534731f commit 4ae879c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions apps/archive/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1275,12 +1275,14 @@ def _send_mark_user_notifications(
:param data: kwargs
"""

user = get_user()
# No notification sent if user is not enabled mark for user notification
if not superdesk.get_resource_service("preferences").mark_for_user_notification_is_enabled(
user_id=user.get("_id")
):
return
filter_user_list = [
user
for user in user_list
if superdesk.get_resource_service("preferences").mark_for_user_notification_is_enabled(
user_id=user.get("_id")
)
]

if item.get("type") == "text":
link_id = item.get("guid", item.get("_id"))
Expand All @@ -1295,11 +1297,11 @@ def _send_mark_user_notifications(

if add_activity:
notify_and_add_activity(
activity_name, msg, resource=resource, item=item, user_list=user_list, link=link, **data
activity_name, msg, resource=resource, item=item, user_list=filter_user_list, link=link, **data
)
# send separate notification for markForUser extension
push_notification(
activity_name, item_id=item.get(config.ID_FIELD), user_list=user_list, extension="markForUser"
activity_name, item_id=item.get(config.ID_FIELD), user_list=filter_user_list, extension="markForUser"
)

def get_items_chain(self, item):
Expand Down

0 comments on commit 4ae879c

Please sign in to comment.