mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-08 15:55:31 +01:00
Updates the Document str to account for a blank title instead of assuming title will be populated
This commit is contained in:
parent
a4927477fb
commit
1707fe8990
1 changed files with 7 additions and 4 deletions
|
|
@ -233,10 +233,13 @@ class Document(models.Model):
|
||||||
# Convert UTC database time to local time
|
# Convert UTC database time to local time
|
||||||
created = datetime.date.isoformat(timezone.localdate(self.created))
|
created = datetime.date.isoformat(timezone.localdate(self.created))
|
||||||
|
|
||||||
if self.correspondent and self.title:
|
res = f"{created}"
|
||||||
return f"{created} {self.correspondent} {self.title}"
|
|
||||||
else:
|
if self.correspondent:
|
||||||
return f"{created} {self.title}"
|
res += f" {self.correspondent}"
|
||||||
|
if self.title:
|
||||||
|
res += f" {self.title}"
|
||||||
|
return res
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source_path(self):
|
def source_path(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue