Skip to content
Merged

task #40

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Mapapi/views/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down