Fixed #1036. API end point now updates

pull/1037/head
hcwinsemius 2021-08-17 14:44:14 +02:00
rodzic 7ee8fc568c
commit 0e24aab704
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -208,6 +208,13 @@ class TaskViewSet(viewsets.ViewSet):
for image in files:
models.ImageUpload.objects.create(task=task, image=image)
task.images_count = models.ImageUpload.objects.filter(task=task).count()
# Update other parameters such as processing node, task name, etc.
print(f"Amount of images currently in task: {task.images_count}")
serializer = TaskSerializer(task, data=request.data, partial=True)
serializer.is_valid(raise_exception=True)
serializer.save()
return Response({'success': True}, status=status.HTTP_200_OK)
@detail_route(methods=['post'])