Przeglądaj źródła

Strip microseconds from JournalEntry creation time

Jeremy Stretch 4 lat temu
rodzic
commit
8a8342b106
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      netbox/extras/models/models.py

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

@@ -413,7 +413,8 @@ class JournalEntry(BigIDModel):
         verbose_name_plural = 'journal entries'
 
     def __str__(self):
-        return f"{self.created} - {self.get_kind_display()}"
+        time_created = self.created.replace(microsecond=0)
+        return f"{time_created} - {self.get_kind_display()}"
 
     def get_kind_class(self):
         return JournalEntryKindChoices.CSS_CLASSES.get(self.kind)