Skip to content

Commit 278a17e

Browse files
committed
fix: fixed pylint issues
1 parent 5cdb65d commit 278a17e

File tree

1 file changed

+3
-6
lines changed
  • openedx/core/djangoapps/notifications

1 file changed

+3
-6
lines changed

openedx/core/djangoapps/notifications/tasks.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ def send_notifications(user_ids, course_key: str, app_name, notification_type, c
141141
grouping_function = NotificationRegistry.get_grouper(notification_type)
142142
waffle_flag_enabled = ENABLE_NOTIFICATION_GROUPING.is_enabled(course_key)
143143
grouping_enabled = waffle_flag_enabled and group_by_id and grouping_function is not None
144-
notifications_generated = False
145144
generated_notification = None
146145
sender_id = context.pop('sender_id', None)
147146
default_web_config = get_default_values_of_preference(app_name, notification_type).get('web', False)
@@ -200,20 +199,18 @@ def send_notifications(user_ids, course_key: str, app_name, notification_type, c
200199

201200
if grouping_enabled and existing_notifications.get(user_id, None):
202201
group_user_notifications(new_notification, existing_notifications[user_id])
203-
if not notifications_generated:
204-
notifications_generated = True
202+
if not generated_notification:
205203
generated_notification = new_notification
206204
else:
207205
notifications.append(new_notification)
208206
generated_notification_audience.append(user_id)
209207

210208
# send notification to users but use bulk_create
211209
notification_objects = Notification.objects.bulk_create(notifications)
212-
if notification_objects and not notifications_generated:
213-
notifications_generated = True
210+
if notification_objects and not generated_notification:
214211
generated_notification = notification_objects[0]
215212

216-
if notifications_generated:
213+
if generated_notification:
217214
notification_generated_event(
218215
generated_notification_audience, app_name, notification_type, course_key, content_url,
219216
generated_notification.content, sender_id=sender_id

0 commit comments

Comments
 (0)