A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Ensure filling in "none" when a tag has not been found
Wolf-Bastian Poettner1ce94348d853
diff --git a/src/documents/models.py b/src/documents/models.pyindex 89a9f5968..69d508350 100644--- a/src/documents/models.py+++ b/src/documents/models.py@@ -326,6 +326,8 @@ class Document(models.Model):def generate_source_filename(self):# Create filename based on configured formatif settings.PAPERLESS_FILENAME_FORMAT is not None:+ tag = defaultdict(lambda: slugify(None),+ self.many_to_dictionary(self.tags))list_length = 10tags = self.many_to_list(self.tags)while True:@@ -336,7 +338,7 @@ class Document(models.Model):title=slugify(self.title),created=slugify(self.created),added=slugify(self.added),- tag=defaultdict(str, self.many_to_dictionary(self.tags)),+ tag=tag,tags=tags)breakexcept IndexError:diff --git a/src/documents/tests/test_file_handling.py b/src/documents/tests/test_file_handling.pyindex fb7f152fc..3065948ea 100644--- a/src/documents/tests/test_file_handling.py+++ b/src/documents/tests/test_file_handling.py@@ -206,7 +206,7 @@ class TestDate(TestCase):# Ensure that filename is properly generatedtmp = document.source_filenameself.assertEqual(document.generate_source_filename(),- "0000001.pdf")+ "none-0000001.pdf")document.create_source_directory()Path(document.source_path).touch()