From 49a107e02742356df6b265d7a8b2a9c9b1058afb Mon Sep 17 00:00:00 2001 From: Erin <121973038+erinysong@users.noreply.github.com> Date: Mon, 15 Apr 2024 15:48:23 -0700 Subject: [PATCH] Convert created to created_at in log entry admin --- src/registrar/admin.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/registrar/admin.py b/src/registrar/admin.py index cd08719c1..36e6e75f5 100644 --- a/src/registrar/admin.py +++ b/src/registrar/admin.py @@ -290,6 +290,13 @@ class CustomLogEntryAdmin(LogEntryAdmin): # Return the field value without a link return f"{obj.content_type} - {obj.object_repr}" + # We name the custom prop 'created_at' because linter + # is not allowing a short_description attr on it + # This gets around the linter limitation, for now. + @admin.display(description=_("Created at")) + def created(self, obj): + return obj.timestamp + search_help_text = "Search by resource, changes, or user." change_form_template = "admin/change_form_no_submit.html"