From 2cd690903976725da2dc696522a89024f85260ea Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 13 Dec 2022 09:05:46 -0500 Subject: [PATCH] Apply configured date format to column render() method --- netbox/netbox/tables/columns.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/netbox/netbox/tables/columns.py b/netbox/netbox/tables/columns.py index 2d90e4bbf..0987b8821 100644 --- a/netbox/netbox/tables/columns.py +++ b/netbox/netbox/tables/columns.py @@ -51,10 +51,12 @@ class DateColumn(tables.DateColumn): tables and null when exporting data. It is registered in the tables library to use this class instead of the default, making this behavior consistent in all fields of type DateField. """ - def value(self, value): + def render(self, value): if value: return date_format(value, format="SHORT_DATE_FORMAT") - return None + + def value(self, value): + return value @classmethod def from_field(cls, field, **kwargs): @@ -444,7 +446,6 @@ class CustomFieldColumn(tables.Column): return escape(item) def render(self, value): - print("render CustomFieldColumn") if self.customfield.type == CustomFieldTypeChoices.TYPE_BOOLEAN and value is True: return mark_safe('') if self.customfield.type == CustomFieldTypeChoices.TYPE_BOOLEAN and value is False: