From c398f22e76ac9e096da84638cb3be58ba3f8321f Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 16 May 2022 00:13:25 -0700 Subject: [PATCH] fix docs update endpoint --- src/documents/serialisers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/documents/serialisers.py b/src/documents/serialisers.py index 564c0aae5..eee4f0f9c 100644 --- a/src/documents/serialisers.py +++ b/src/documents/serialisers.py @@ -209,7 +209,7 @@ class DocumentSerializer(DynamicFieldsModelSerializer): original_file_name = SerializerMethodField() archived_file_name = SerializerMethodField() - created_date = serializers.DateField() + created_date = serializers.DateField(required=False) def get_original_file_name(self, obj): return obj.get_public_filename() @@ -228,6 +228,8 @@ class DocumentSerializer(DynamicFieldsModelSerializer): ) instance.created = new_datetime instance.save() + validated_data.pop("created_date") + super().update(instance, validated_data) return instance class Meta: