Fix: handle uuid fields created under mariadb and Django 4 (#8034)

This commit is contained in:
shamoon authored and GitHub committed 2024-10-28 13:54:16 +00:00
1 parent 335c6c3820
commit 28fdb170bf
8 files changed
+128 -7

No files matched your search

+11 -1
View File
@@ -406,7 +406,17 @@ class DocumentViewSet(
from documents import index
index.remove_document_from_index(self.get_object())
return super().destroy(request, *args, **kwargs)
try:
return super().destroy(request, *args, **kwargs)
except Exception as e:
if "Data too long for column" in str(e):
logger.warning(
"Detected a possible incompatible database column. See https://docs.paperless-ngx.com/troubleshooting/#convert-uuid-field",
)
logger.error(f"Error deleting document: {e!s}")
return HttpResponseBadRequest(
"Error deleting document, check logs for more detail.",
)
@staticmethod
def original_requested(request):