Skip to content

Commit

Permalink
Implemented DELETE method for a task.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmanovic committed Feb 6, 2019
1 parent 3e87bc3 commit 090da2f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cvat/apps/engine/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import json
import traceback
from ast import literal_eval
import shutil

from django.http import HttpResponse, HttpResponseBadRequest, JsonResponse
from django.shortcuts import redirect, render, get_object_or_404
Expand Down Expand Up @@ -93,8 +94,10 @@ class TaskViewSet(viewsets.ModelViewSet):
queryset = Task.objects.all()
serializer_class = TaskSerializer

def get_serializer_class(self):
return self.serializer_class
def perform_destroy(self, instance):
task_dirname = instance.get_task_dirname()
super().perform_destroy(instance)
shutil.rmtree(task_dirname, ignore_errors=True)

@action(detail=True, methods=['GET'], serializer_class=JobSerializer)
def jobs(self, request, pk):
Expand Down

0 comments on commit 090da2f

Please sign in to comment.