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

This commit is contained in:
Trenton Holmes committed 2022-05-13 09:10:36 -07:00
1 parent 38f4bf4e28
commit f3dced3199
3 files changed
+39 -23

No files matched your search

+3 -1
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}"