Skip to content

Commit

Permalink
fix: api counter
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Nov 13, 2024
1 parent 28fdc3e commit 85ac407
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions uniticket/api_rest/views/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})
2 changes: 1 addition & 1 deletion uniticket/uni_ticket/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ def get_ticket_per_structure(structure,
ticket_assignments = TicketAssignment.objects\
.filter(
q_base
).values_list("ticket__pk", flat=True)\
).select_related('ticket')\
.order_by(*ordering_list)\
.distinct()

Expand Down

0 comments on commit 85ac407

Please sign in to comment.