From 0d25ad57008e2bfe5a3fb718c129d3e97c46cc30 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Thu, 18 Aug 2022 10:51:10 +0200 Subject: [PATCH] fix no script.author --- teleforma/exam/admin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/teleforma/exam/admin.py b/teleforma/exam/admin.py index e7354af7..83998e16 100644 --- a/teleforma/exam/admin.py +++ b/teleforma/exam/admin.py @@ -59,7 +59,10 @@ class ScriptAdmin(admin.ModelAdmin): return super(ScriptAdmin, self).render_change_form(request, context, *args, **kwargs) def author_name(self, instance): - return instance.author.username + if instance.author: + return instance.author.username + else: + return 'None' def file_size(self, instance): if instance.file: -- 2.39.5