From 4e7963c90d56450015e6e67259c33e01a4c0e5b3 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Sat, 19 Aug 2023 11:24:14 -0700 Subject: [PATCH] Fix pretty logs admin for orders with no logs recorded --- api/admin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/admin.py b/api/admin.py index 6f91193b..0846ad67 100644 --- a/api/admin.py +++ b/api/admin.py @@ -129,6 +129,8 @@ class OrderAdmin(AdminChangeLinksMixin, admin.ModelAdmin): readonly_fields = ("reference", "_logs") def _logs(self, obj): + if not obj.logs: + return format_html("No logs were recorded") with_hyperlinks = objects_to_hyperlinks(obj.logs) return format_html(f'{with_hyperlinks}
')