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

This commit is contained in:
jeremystretch 2021-04-23 15:27:58 -04:00
parent 1dd9f8c1d4
commit 2618dde1e2
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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])