🔊(backend) add some log to trace conversion made on docs creation

We added logs on the conversion made when a doc is created.
This commit is contained in:
Manuel Raynaud
2026-03-25 17:08:14 +01:00
parent 330096eb47
commit f91223fe4a
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -693,7 +693,9 @@ class DocumentViewSet(
)
serializer.validated_data["content"] = converted_content
serializer.validated_data["title"] = uploaded_file.name
logger.info("conversion ended successfully")
except ConversionError as err:
logger.error("could not convert file content with error: %s", err)
raise drf.exceptions.ValidationError(
{"file": ["Could not convert file content"]}
) from err
@@ -45,6 +45,8 @@ class Converter:
def convert(self, data, content_type, accept):
"""Convert input into other formats using external microservices."""
logger.info("converting content from %s to %s", content_type, accept)
if content_type == mime_types.DOCX and accept == mime_types.YJS:
blocknote_data = self.docspec.convert(
data, mime_types.DOCX, mime_types.BLOCKNOTE