fix: notification count only for web (#36459)
This commit is contained in:
@@ -793,6 +793,7 @@ class NotificationCountViewSetTestCase(ModuleStoreTestCase):
|
||||
Notification.objects.create(user=self.user, app_name='App Name 1', notification_type='Type B')
|
||||
Notification.objects.create(user=self.user, app_name='App Name 2', notification_type='Type A')
|
||||
Notification.objects.create(user=self.user, app_name='App Name 3', notification_type='Type C')
|
||||
Notification.objects.create(user=self.user, app_name='App Name 4', notification_type='Type D', web=False)
|
||||
|
||||
@override_waffle_flag(ENABLE_NOTIFICATIONS, active=True)
|
||||
@ddt.unpack
|
||||
|
||||
@@ -332,7 +332,7 @@ class NotificationCountView(APIView):
|
||||
# Get the unseen notifications count for each app name.
|
||||
count_by_app_name = (
|
||||
Notification.objects
|
||||
.filter(user_id=request.user, last_seen__isnull=True)
|
||||
.filter(user_id=request.user, last_seen__isnull=True, web=True)
|
||||
.values('app_name')
|
||||
.annotate(count=Count('*'))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user