From 64011a93420f48604208044786df056dacc05c81 Mon Sep 17 00:00:00 2001 From: Ketan <73937490+devketanpro@users.noreply.github.com> Date: Wed, 24 Jul 2024 10:57:17 +0530 Subject: [PATCH] update name of assignment notification prefrence [SDBELGA-818] (#2035) * update name of assignment notification prefrence [SDBELGA-818] * fix black --- client/planning-extension/src/extension.ts | 2 +- server/planning/assignments/__init__.py | 2 +- server/planning/assignments/assignments.py | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/client/planning-extension/src/extension.ts b/client/planning-extension/src/extension.ts index a2b50c747..141e04010 100644 --- a/client/planning-extension/src/extension.ts +++ b/client/planning-extension/src/extension.ts @@ -128,7 +128,7 @@ const extension: IExtension = { }, }, }, - notifications: {'assignment:notification': {type: 'email'}}, + notifications: {'email:notification:assignments': {type: 'email'}}, globalMenuHorizontal: displayTopbarWidget ? [AssignmentsList] : [], }, }; diff --git a/server/planning/assignments/__init__.py b/server/planning/assignments/__init__.py index f6d686621..3b489762c 100644 --- a/server/planning/assignments/__init__.py +++ b/server/planning/assignments/__init__.py @@ -139,7 +139,7 @@ def init_app(app): ) superdesk.register_default_user_preference( - "assignment:notification", + "email:notification:assignments", { "type": "bool", "enabled": True, diff --git a/server/planning/assignments/assignments.py b/server/planning/assignments/assignments.py index d227606b7..e3e730b89 100644 --- a/server/planning/assignments/assignments.py +++ b/server/planning/assignments/assignments.py @@ -349,9 +349,8 @@ def send_assignment_notification(self, updates, original=None, force=False): # No assignment notification sent, if user is not enabled assignment notification if assigned_to.get("user") and not superdesk.get_resource_service( "preferences" - ).assignment_notification_is_enabled(user_id=assigned_to.get("user")): + ).check_preference_email_notification_is_enabled("assignments", user_id=assigned_to.get("user")): return - assignment_id = updates.get("_id") or assigned_to.get("assignment_id", "Unknown") if not original: original = {}