mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-10 00:18:57 +00:00
Fix: handle uuid fields created under mariadb and Django 4 (#8034)
This commit is contained in:
@@ -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):
|
||||
|
Reference in New Issue
Block a user