💥(backend) remove the documents/{id}/content/ endpoint

Both its PATCH and its GET: the content of a document is saved and
served by the collaboration server. The `content_patch` and
`content_retrieve` abilities go with it.
This commit is contained in:
Manuel Raynaud
2026-09-23 12:06:05 +02:00
parent a2fbec6c4c
commit 56d2a0bde6
17 changed files with 13 additions and 1418 deletions
-29
View File
@@ -1,9 +1,7 @@
"""Client serializers for the impress core app."""
# pylint: disable=too-many-lines
import binascii
import mimetypes
from base64 import b64decode
from os.path import splitext
from django.conf import settings
@@ -308,33 +306,6 @@ class SearchDocumentSerializer(ListDocumentSerializer):
read_only_fields = ListDocumentSerializer.Meta.read_only_fields + ["parent"]
class DocumentContentSerializer(serializers.Serializer):
"""Serializer for updating only the raw content of a document stored in S3."""
content = serializers.CharField(required=True)
def validate_content(self, value):
"""Validate the content field."""
try:
b64decode(value, validate=True)
except binascii.Error as err:
raise serializers.ValidationError("Invalid base64 content.") from err
return value
def update(self, instance, validated_data):
"""
This serializer does not support updates.
"""
raise NotImplementedError("Update is not supported for this serializer.")
def create(self, validated_data):
"""
This serializer does not support create.
"""
raise NotImplementedError("Create is not supported for this serializer.")
class DocumentAccessSerializer(serializers.ModelSerializer):
"""Serialize document accesses."""