Skip to content

Commit 79f33a6

Browse files
fix: notification count only for web (#36459)
1 parent 1303965 commit 79f33a6

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

openedx/core/djangoapps/notifications/tests/test_views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,7 @@ def setUp(self):
793793
Notification.objects.create(user=self.user, app_name='App Name 1', notification_type='Type B')
794794
Notification.objects.create(user=self.user, app_name='App Name 2', notification_type='Type A')
795795
Notification.objects.create(user=self.user, app_name='App Name 3', notification_type='Type C')
796+
Notification.objects.create(user=self.user, app_name='App Name 4', notification_type='Type D', web=False)
796797

797798
@override_waffle_flag(ENABLE_NOTIFICATIONS, active=True)
798799
@ddt.unpack

openedx/core/djangoapps/notifications/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def get(self, request):
332332
# Get the unseen notifications count for each app name.
333333
count_by_app_name = (
334334
Notification.objects
335-
.filter(user_id=request.user, last_seen__isnull=True)
335+
.filter(user_id=request.user, last_seen__isnull=True, web=True)
336336
.values('app_name')
337337
.annotate(count=Count('*'))
338338
)

0 commit comments

Comments
 (0)