]> git.parisson.com Git - teleforma.git/commitdiff
fix script title
authorGuillaume Pellerin <yomguy@parisson.com>
Tue, 14 Jul 2015 17:15:22 +0000 (19:15 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Tue, 14 Jul 2015 17:15:22 +0000 (19:15 +0200)
teleforma/exam/models.py

index 739512951b263498749e726781397a559231b79a..d87be17eb4edbbf428d58981317a180ba340714c 100644 (file)
@@ -243,9 +243,10 @@ class Script(BaseResource):
 
     @property
     def title(self):
-        return ' - '.join([self.course.title, self.type.name, _("Session") + ' ' + self.session,
-                        unicode(self.author.first_name) + ' ' + unicode(self.author.last_name),
-                        unicode(self.date_added)])
+        title = [self.course.title, self.type.name, _("Session") + ' ' + self.session, unicode(self.date_added)]
+        if self.author:
+            title.append(unicode(self.author.first_name) + ' ' + unicode(self.author.last_name))
+        return ' - '.join(title)
 
     def __unicode__(self):
         return unicode(self.title)