From: Guillaume Pellerin Date: Thu, 18 Aug 2022 08:51:10 +0000 (+0200) Subject: fix no script.author X-Git-Tag: 2.9.0~96 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=0d25ad57008e2bfe5a3fb718c129d3e97c46cc30;p=teleforma.git fix no script.author --- 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: