A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Fixes minor depracation I noticed
Trenton Holmesefaa1c4dd77f
diff --git a/src/documents/signals/handlers.py b/src/documents/signals/handlers.pyindex 4c2554f02..cd42c9030 100644--- a/src/documents/signals/handlers.py+++ b/src/documents/signals/handlers.py@@ -447,7 +447,7 @@ def update_filename_and_move_files(sender, instance, **kwargs):)except (OSError, DatabaseError, CannotMoveFilesException) as e:- logger.warn(f"Exception during file handling: {e}")+ logger.warning(f"Exception during file handling: {e}")# This happens when either:# - moving the files failed due to file system errors# - saving to the database failed due to database errorsdiff --git a/src/documents/views.py b/src/documents/views.pyindex 147dd2e07..abd2e5f2f 100644--- a/src/documents/views.py+++ b/src/documents/views.py@@ -12,6 +12,7 @@ from time import mktimefrom unicodedata import normalizefrom urllib.parse import quote+import pathvalidatefrom django.conf import settingsfrom django.contrib.auth.models import Userfrom django.db.models import Case@@ -625,7 +626,7 @@ class PostDocumentView(GenericAPIView):os.makedirs(settings.SCRATCH_DIR, exist_ok=True)temp_file_path = Path(tempfile.mkdtemp(dir=settings.SCRATCH_DIR)) / Path(- doc_name,+ pathvalidate.sanitize_filename(doc_name),)temp_file_path.write_bytes(doc_data)@@ -634,8 +635,9 @@ class PostDocumentView(GenericAPIView):task_id = str(uuid.uuid4())- async_task = consume_file.delay(- temp_file_path,+ consume_file.delay(+ # Paths are not JSON friendly+ str(temp_file_path),override_title=title,override_correspondent_id=correspondent_id,override_document_type_id=document_type_id,