From 4057a3a5181718f9b5f15e7347a8dffe102e3c3a Mon Sep 17 00:00:00 2001 From: Francesco Filicetti Date: Wed, 13 Nov 2024 15:13:30 +0100 Subject: [PATCH] fix: api counter --- uniticket/api_rest/views/manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uniticket/api_rest/views/manager.py b/uniticket/api_rest/views/manager.py index c79f721..9992f3d 100644 --- a/uniticket/api_rest/views/manager.py +++ b/uniticket/api_rest/views/manager.py @@ -49,7 +49,7 @@ def get(self, request, structure_slug, *args, **kwargs): ).values_list('ticket__pk', flat=True).distinct() messages = TicketReply.get_unread_messages_count(ticket_ids=ticket_ids) - return Response({'unassigned': len(unassigned_tickets), - 'open': len(open_tickets), - 'my_open': len(my_open_tickets), + return Response({'unassigned': unassigned_tickets.count(), + 'open': open_tickets.count(), + 'my_open': my_open_tickets.count(), 'new_messages': messages})