From 928e810b3333774c4ee22b756a48fcae9467195e Mon Sep 17 00:00:00 2001 From: Saad Yousaf Date: Fri, 26 Jan 2024 15:11:53 +0500 Subject: [PATCH] Revert "temp: add temporary logs for course wide notifications" --- .../discussion/rest_api/discussions_notifications.py | 7 ------- openedx/core/djangoapps/notifications/audience_filters.py | 6 ------ openedx/core/djangoapps/notifications/handlers.py | 4 ---- 3 files changed, 17 deletions(-) diff --git a/lms/djangoapps/discussion/rest_api/discussions_notifications.py b/lms/djangoapps/discussion/rest_api/discussions_notifications.py index 31f158fbd742..cba7852023ef 100644 --- a/lms/djangoapps/discussion/rest_api/discussions_notifications.py +++ b/lms/djangoapps/discussion/rest_api/discussions_notifications.py @@ -1,8 +1,6 @@ """ Discussion notifications sender util. """ -import logging - from django.conf import settings from lms.djangoapps.discussion.django_comment_client.permissions import get_team from openedx_events.learning.data import UserNotificationData, CourseNotificationData @@ -22,9 +20,6 @@ ) -log = logging.getLogger(__name__) - - class DiscussionNotificationSender: """ Class to send notifications to users who are subscribed to the thread. @@ -262,8 +257,6 @@ def send_new_thread_created_notification(self): 'username': self.creator.username, 'post_title': self.thread.title } - - log.info(f"Temp: Audience filter for course-wide notification is {audience_filters}") self._send_course_wide_notification(notification_type, audience_filters, context) diff --git a/openedx/core/djangoapps/notifications/audience_filters.py b/openedx/core/djangoapps/notifications/audience_filters.py index 8d02bb3ea756..fe9a047f78ca 100644 --- a/openedx/core/djangoapps/notifications/audience_filters.py +++ b/openedx/core/djangoapps/notifications/audience_filters.py @@ -1,7 +1,6 @@ """ Audience based filters for notifications """ -import logging from abc import abstractmethod @@ -22,9 +21,6 @@ ) -log = logging.getLogger(__name__) - - class NotificationAudienceFilterBase: """ Base class for notification audience filters @@ -84,12 +80,10 @@ def filter(self, course_roles): if 'staff' in course_roles: staff_users = CourseStaffRole(course_key).users_with_role().values_list('id', flat=True) - log.info(f'Temp: Course wide notification, staff users calculated are {staff_users}') user_ids.extend(staff_users) if 'instructor' in course_roles: instructor_users = CourseInstructorRole(course_key).users_with_role().values_list('id', flat=True) - log.info(f'Temp: Course wide notification, instructor users calculated are {instructor_users}') user_ids.extend(instructor_users) return user_ids diff --git a/openedx/core/djangoapps/notifications/handlers.py b/openedx/core/djangoapps/notifications/handlers.py index 6f8b4775b936..dcd5f1ec1ee9 100644 --- a/openedx/core/djangoapps/notifications/handlers.py +++ b/openedx/core/djangoapps/notifications/handlers.py @@ -96,13 +96,10 @@ def calculate_course_wide_notification_audience(course_key, audience_filters): if filter_class: filter_instance = filter_class(course_key) filtered_users = filter_instance.filter(filter_values) - log.info(f'Temp: Course-wide notification filtered users are ' - f'{filtered_users} for filter type {filter_type}') audience_user_ids.extend(filtered_users) else: raise ValueError(f"Invalid audience filter type: {filter_type}") - log.info(f'Temp: Course-wide notification after audience filter is applied, users: {list(set(audience_user_ids))}') return list(set(audience_user_ids)) @@ -131,5 +128,4 @@ def generate_course_notifications(signal, sender, course_notification_data, meta 'content_url': course_notification_data.get('content_url'), } - log.info(f"Temp: Course-wide notification, user_ids to sent notifications to {notification_data.get('user_ids')}") send_notifications.delay(**notification_data)