mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Merge pull request #1057 from paperless-ngx/bugfix-document-str
Bugfix: Don't assume the document has a title set
This commit is contained in:
commit
2abe6eec84
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user