]> git.parisson.com Git - teleforma.git/commitdiff
Fix no script type
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Fri, 26 Jan 2018 08:43:40 +0000 (09:43 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Fri, 26 Jan 2018 08:43:40 +0000 (09:43 +0100)
teleforma/exam/models.py

index 338a31402a464313b8ef9bf8a5b19011f954196c..07c2d0a582cfe269fe28861a91f56f179e1d899a 100644 (file)
@@ -262,7 +262,10 @@ class Script(BaseResource):
 
     @property
     def title(self):
-        title = [self.course.title, self.type.name, _("Session") + ' ' + self.session, unicode(self.date_added)]
+        if self.type.name:
+            title = [self.course.title, self.type.name, _("Session") + ' ' + self.session, unicode(self.date_added)]
+        else:
+            title = [self.course.title, _("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)