]> git.parisson.com Git - teleforma.git/commitdiff
fix no script.author
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 18 Aug 2022 08:51:10 +0000 (10:51 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 18 Aug 2022 08:51:10 +0000 (10:51 +0200)
teleforma/exam/admin.py

index e7354af793d9784832afaf700871485135d80bce..83998e16f87e3cbd4082ec55b444d3cb88e9f412 100644 (file)
@@ -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: