From 8183de49022b43f66412bce434cbb1fd942e8f95 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Sat, 13 Aug 2022 07:13:51 -0700 Subject: [PATCH] `created_date` is not supposed to be required --- src/documents/serialisers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/documents/serialisers.py b/src/documents/serialisers.py index c83dc2541..a1db44791 100644 --- a/src/documents/serialisers.py +++ b/src/documents/serialisers.py @@ -240,7 +240,8 @@ class DocumentSerializer(DynamicFieldsModelSerializer): ) instance.created = new_datetime instance.save() - validated_data.pop("created_date") + if "created_date" in validated_data: + validated_data.pop("created_date") super().update(instance, validated_data) return instance