MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / unread_count

Method unread_count

core/api_views.py:714–724  ·  view source on GitHub ↗

Get count of unread notifications.

(self, request)

Source from the content-addressed store, hash-verified

712
713 @action(detail=False, methods=['get'], url_path='count')
714 def unread_count(self, request):
715 """Get count of unread notifications."""
716 queryset = self.get_queryset()
717 dismissed_ids = NotificationDismissal.objects.filter(
718 user=request.user
719 ).values_list('notification_id', flat=True)
720 unread_count = queryset.exclude(id__in=dismissed_ids).count()
721
722 return Response({
723 'unread_count': unread_count
724 })
725

Callers

nothing calls this directly

Calls 2

get_querysetMethod · 0.95
filterMethod · 0.45

Tested by

no test coverage detected