]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Updates the Document str to account for a blank title instead of assuming title will... 1057/head
authorTrenton Holmes <holmes.trenton@gmail.com>
Wed, 1 Jun 2022 15:03:38 +0000 (08:03 -0700)
committerTrenton Holmes <holmes.trenton@gmail.com>
Wed, 1 Jun 2022 15:03:38 +0000 (08:03 -0700)
src/documents/models.py

index b85c56037a3157049fdf2dad35fe2f988171696b..0061e5d0fc44670bf36605abccdcd1b4507a17db 100644 (file)
@@ -233,10 +233,13 @@ class Document(models.Model):
         # Convert UTC database time to local time
         created = datetime.date.isoformat(timezone.localdate(self.created))
 
-        if self.correspondent and self.title:
-            return f"{created} {self.correspondent} {self.title}"
-        else:
-            return f"{created} {self.title}"
+        res = f"{created}"
+
+        if self.correspondent:
+            res += f" {self.correspondent}"
+        if self.title:
+            res += f" {self.title}"
+        return res
 
     @property
     def source_path(self):