mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-07 23:35:22 +01:00
Fix: handle uuid fields created under mariadb and Django 4 (#8034)
This commit is contained in:
parent
335c6c3820
commit
28fdb170bf
8 changed files with 128 additions and 7 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue