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'])