From 01bacea4023a50d151162e7ee4b9de337528c691 Mon Sep 17 00:00:00 2001 From: Kaicedra Consulting SAS Date: Thu, 25 Jun 2026 17:44:50 +0000 Subject: [PATCH] task --- Mapapi/views/task.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Mapapi/views/task.py b/Mapapi/views/task.py index cfc3a885..13eeb1ba 100644 --- a/Mapapi/views/task.py +++ b/Mapapi/views/task.py @@ -20,9 +20,12 @@ class IncidentTaskListCreateView(generics.ListCreateAPIView): permission_classes = [IsAuthenticated, IsIncidentLeaderOrContributor] def get_queryset(self): - return IncidentTask.objects.filter( - incident_id=self.kwargs['incident_id'] - ).order_by('start_date', 'id') + incident_id = self.kwargs['incident_id'] + qs = IncidentTask.objects.filter(incident_id=incident_id).order_by('start_date', 'id') + print(f"DEBUG: incident_id={incident_id}, tasks count={qs.count()}") + if qs.count() > 0: + print(f"DEBUG: task IDs = {list(qs.values_list('id', flat=True))}") + return qs def perform_create(self, serializer): incident = Incident.objects.get(pk=self.kwargs['incident_id'])