diff --git a/backend/labels/serializers.py b/backend/labels/serializers.py index 059003cf..d3d04a57 100644 --- a/backend/labels/serializers.py +++ b/backend/labels/serializers.py @@ -59,7 +59,7 @@ class TextLabelSerializer(serializers.ModelSerializer): read_only_fields = ('user',) -class AnnotationRelationsSerializer(serializers.ModelSerializer): +class RelationSerializer(serializers.ModelSerializer): def validate(self, attrs): return super().validate(attrs) diff --git a/backend/labels/views.py b/backend/labels/views.py index b689111c..3a0715b5 100644 --- a/backend/labels/views.py +++ b/backend/labels/views.py @@ -10,7 +10,7 @@ from api.models import Project from labels.models import Category, Span, TextLabel, AnnotationRelations from members.permissions import IsInProjectOrAdmin, IsInProjectReadOnlyOrAdmin from .permissions import CanEditAnnotation -from .serializers import CategorySerializer, SpanSerializer, TextLabelSerializer, AnnotationRelationsSerializer +from .serializers import CategorySerializer, SpanSerializer, TextLabelSerializer, RelationSerializer class BaseListAPI(generics.ListCreateAPIView): @@ -100,7 +100,7 @@ class TextLabelDetailAPI(BaseDetailAPI): class RelationList(generics.ListCreateAPIView): - serializer_class = AnnotationRelationsSerializer + serializer_class = RelationSerializer pagination_class = None permission_classes = [IsAuthenticated & IsInProjectReadOnlyOrAdmin] @@ -120,6 +120,6 @@ class RelationList(generics.ListCreateAPIView): class RelationDetail(generics.RetrieveUpdateDestroyAPIView): queryset = AnnotationRelations.objects.all() - serializer_class = AnnotationRelationsSerializer + serializer_class = RelationSerializer lookup_url_kwarg = 'annotation_relation_id' permission_classes = [IsAuthenticated & IsInProjectReadOnlyOrAdmin]