mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
fix docs update endpoint
This commit is contained in:
parent
063f6c1d5a
commit
c398f22e76
@ -209,7 +209,7 @@ class DocumentSerializer(DynamicFieldsModelSerializer):
|
|||||||
|
|
||||||
original_file_name = SerializerMethodField()
|
original_file_name = SerializerMethodField()
|
||||||
archived_file_name = SerializerMethodField()
|
archived_file_name = SerializerMethodField()
|
||||||
created_date = serializers.DateField()
|
created_date = serializers.DateField(required=False)
|
||||||
|
|
||||||
def get_original_file_name(self, obj):
|
def get_original_file_name(self, obj):
|
||||||
return obj.get_public_filename()
|
return obj.get_public_filename()
|
||||||
@ -228,6 +228,8 @@ class DocumentSerializer(DynamicFieldsModelSerializer):
|
|||||||
)
|
)
|
||||||
instance.created = new_datetime
|
instance.created = new_datetime
|
||||||
instance.save()
|
instance.save()
|
||||||
|
validated_data.pop("created_date")
|
||||||
|
super().update(instance, validated_data)
|
||||||
return instance
|
return instance
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user