Fixes Document public filename so it will use the local date instead of UTC date

This commit is contained in:
Trenton Holmes
2022-05-13 09:10:36 -07:00
parent 38f4bf4e28
commit f3dced3199
3 changed files with 39 additions and 23 deletions

View File

@@ -208,7 +208,9 @@ class Document(models.Model):
verbose_name_plural = _("documents")
def __str__(self):
created = datetime.date.isoformat(self.created)
# 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}"