Просмотр исходного кода

Fixes #6236: Journal entry title should account for configured timezone

jeremystretch 4 лет назад
Родитель
Сommit
2618dde1e2
2 измененных файлов с 4 добавлено и 1 удалено
  1. 1 0
      docs/release-notes/version-2.11.md
  2. 3 1
      netbox/extras/models/models.py

+ 1 - 0
docs/release-notes/version-2.11.md

@@ -4,6 +4,7 @@
 
 ### Bug Fixes
 
+* [#6236](https://github.com/netbox-community/netbox/issues/6236) - Journal entry title should account for configured timezone
 * [#6246](https://github.com/netbox-community/netbox/issues/6246) - Permit full-length descriptions when creating device components and VM interfaces
 * [#6248](https://github.com/netbox-community/netbox/issues/6248) - Fix table column reconfiguration under Chrome
 * [#6252](https://github.com/netbox-community/netbox/issues/6252) - Fix assignment of console port speed values above 19.2kbps

+ 3 - 1
netbox/extras/models/models.py

@@ -431,7 +431,9 @@ class JournalEntry(ChangeLoggedModel):
         verbose_name_plural = 'journal entries'
 
     def __str__(self):
-        return f"{date_format(self.created)} - {time_format(self.created)} ({self.get_kind_display()})"
+        created_date = timezone.localdate(self.created)
+        created_time = timezone.localtime(self.created)
+        return f"{date_format(created_date)} - {time_format(created_time)} ({self.get_kind_display()})"
 
     def get_absolute_url(self):
         return reverse('extras:journalentry', args=[self.pk])