Set the document type in the document serializer to read only.

This change improves PUT requests and changing the document type
via the API is not supported anyways.
This commit is contained in:
Roberto Rosario
2017-01-30 00:46:56 -04:00
parent c81a15f4f0
commit 3634284c5c

View File

@@ -161,6 +161,7 @@ class DocumentSerializer(serializers.HyperlinkedModelSerializer):
'latest_version', 'url', 'uuid', 'versions',
)
model = Document
read_only_fields = ('document_type',)
class NewDocumentSerializer(serializers.ModelSerializer):