Browse Source

Ensure read_only_fields are consistent

pull/532/head
Clemens Wolff 4 years ago
parent
commit
af8ca8de19
1 changed files with 4 additions and 4 deletions
  1. 8
      app/api/serializers.py

8
app/api/serializers.py

@ -106,7 +106,7 @@ class ProjectSerializer(serializers.ModelSerializer):
model = Project
fields = ('id', 'name', 'description', 'guideline', 'users', 'current_users_role', 'project_type', 'image',
'updated_at', 'randomize_document_order', 'collaborative_annotation')
read_only_fields = ('image', 'updated_at', 'current_users_role')
read_only_fields = ('image', 'updated_at', 'users', 'current_users_role')
class TextClassificationProjectSerializer(ProjectSerializer):
@ -115,7 +115,7 @@ class TextClassificationProjectSerializer(ProjectSerializer):
model = TextClassificationProject
fields = ('id', 'name', 'description', 'guideline', 'users', 'current_users_role', 'project_type', 'image',
'updated_at', 'randomize_document_order')
read_only_fields = ('image', 'updated_at', 'users', 'current_users_role')
read_only_fields = ProjectSerializer.Meta.read_only_fields
class SequenceLabelingProjectSerializer(ProjectSerializer):
@ -124,7 +124,7 @@ class SequenceLabelingProjectSerializer(ProjectSerializer):
model = SequenceLabelingProject
fields = ('id', 'name', 'description', 'guideline', 'users', 'current_users_role', 'project_type', 'image',
'updated_at', 'randomize_document_order')
read_only_fields = ('image', 'updated_at', 'users', 'current_users_role')
read_only_fields = ProjectSerializer.Meta.read_only_fields
class Seq2seqProjectSerializer(ProjectSerializer):
@ -133,7 +133,7 @@ class Seq2seqProjectSerializer(ProjectSerializer):
model = Seq2seqProject
fields = ('id', 'name', 'description', 'guideline', 'users', 'current_users_role', 'project_type', 'image',
'updated_at', 'randomize_document_order')
read_only_fields = ('image', 'updated_at', 'users', 'current_users_role')
read_only_fields = ProjectSerializer.Meta.read_only_fields
class ProjectPolymorphicSerializer(PolymorphicSerializer):

Loading…
Cancel
Save