Skip to content

Commit

Permalink
Add 'new/unread alerts' in stats
Browse files Browse the repository at this point in the history
  • Loading branch information
eax64 committed Aug 11, 2016
1 parent 42b5609 commit 36feb99
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vigilate_backend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ def stats(self, request, pk=None):

data = {"programs" : UserPrograms.objects.filter(user=pk).count(),
"stations" : Station.objects.filter(user=pk).count(),
"alerts": Alert.objects.filter(user=pk).count()}
"alerts": Alert.objects.filter(user=pk).count(),
"new_alerts": Alert.objects.filter(user=pk, view=False).count()
}

return HttpResponse(json.dumps(data))

Expand Down

0 comments on commit 36feb99

Please sign in to comment.