From a7c2e6a566dfddfb34129e9ccdcb971d1f89e093 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Wed, 21 Oct 2020 11:54:05 +0300 Subject: [PATCH] Some fixes --- cvat/apps/authentication/auth.py | 2 +- cvat/apps/engine/serializers.py | 5 +++++ cvat/apps/engine/views.py | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cvat/apps/authentication/auth.py b/cvat/apps/authentication/auth.py index 346e729656ad..60bb2f18d8b2 100644 --- a/cvat/apps/authentication/auth.py +++ b/cvat/apps/authentication/auth.py @@ -267,7 +267,7 @@ def has_object_permission(self, request, view, obj): class JobAccessPermission(BasePermission): # pylint: disable=no-self-use def has_object_permission(self, request, view, obj): - return request.user.has_perm('engine.job.access"', obj) + return request.user.has_perm('engine.job.access', obj) class JobChangePermission(BasePermission): # pylint: disable=no-self-use diff --git a/cvat/apps/engine/serializers.py b/cvat/apps/engine/serializers.py index dc555b16a958..aa824f5c40f6 100644 --- a/cvat/apps/engine/serializers.py +++ b/cvat/apps/engine/serializers.py @@ -530,6 +530,11 @@ def to_representation(self, instance): } class IssueSerializer(serializers.ModelSerializer): + roi = serializers.ListField( + child=serializers.FloatField(), + allow_empty=False, + ) + class Meta: model = models.Issue fields = '__all__' diff --git a/cvat/apps/engine/views.py b/cvat/apps/engine/views.py index 413513d87e0c..f88b32a6cb83 100644 --- a/cvat/apps/engine/views.py +++ b/cvat/apps/engine/views.py @@ -760,6 +760,7 @@ def get_permissions(self): return [perm() for perm in permissions] + @method_decorator(name='destroy', decorator=swagger_auto_schema(operation_summary='Method removes an issue from a job')) class IssueViewSet(viewsets.GenericViewSet, mixins.DestroyModelMixin): queryset = Issue.objects.all().order_by('id')