A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Fix for #107
Daniel Quinne96c7448bc11
diff --git a/src/documents/consumer.py b/src/documents/consumer.pyindex 5e4f1b8b8..bac93647e 100644--- a/src/documents/consumer.py+++ b/src/documents/consumer.py@@ -292,16 +292,18 @@ class Consumer(object):self.log("debug", "Saving record to database")- document = Document.objects.create(- correspondent=file_info.correspondent,- title=file_info.title,- content=text,- file_type=file_info.extension,- created=timezone.make_aware(- datetime.datetime.fromtimestamp(stats.st_mtime)),- modified=timezone.make_aware(- datetime.datetime.fromtimestamp(stats.st_mtime))- )+ with open(doc, "rb") as f:+ document = Document.objects.create(+ correspondent=file_info.correspondent,+ title=file_info.title,+ content=text,+ file_type=file_info.extension,+ checksum=hashlib.md5(f.read()).hexdigest(),+ created=timezone.make_aware(+ datetime.datetime.fromtimestamp(stats.st_mtime)),+ modified=timezone.make_aware(+ datetime.datetime.fromtimestamp(stats.st_mtime))+ )relevant_tags = set(list(Tag.match_all(text)) + list(file_info.tags))if relevant_tags: