From 6003122b0684450993efd7c82c7cace927473e08 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 9 Dec 2020 22:16:57 +0100 Subject: [PATCH] fixes #112 --- src/documents/consumer.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/documents/consumer.py b/src/documents/consumer.py index 19ca3ed7e..e4da51f1d 100755 --- a/src/documents/consumer.py +++ b/src/documents/consumer.py @@ -248,7 +248,7 @@ class Consumer(LoggingMixin): with open(self.path, "rb") as f: document = Document.objects.create( correspondent=file_info.correspondent, - title=file_info.title, + title=(self.override_title or file_info.title)[:127], content=text, mime_type=mime_type, checksum=hashlib.md5(f.read()).hexdigest(), @@ -265,12 +265,11 @@ class Consumer(LoggingMixin): self.apply_overrides(document) + document.save() + return document def apply_overrides(self, document): - if self.override_title: - document.title = self.override_title - if self.override_correspondent_id: document.correspondent = Correspondent.objects.get( pk=self.override_correspondent_id)