From: Guillaume Pellerin Date: Fri, 26 Jan 2018 08:43:40 +0000 (+0100) Subject: Fix no script type X-Git-Tag: 1.2~9 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=f30a0ba635244f7c9e8dbe7f435b8c9316f351cb;p=teleforma.git Fix no script type --- diff --git a/teleforma/exam/models.py b/teleforma/exam/models.py index 338a3140..07c2d0a5 100644 --- a/teleforma/exam/models.py +++ b/teleforma/exam/models.py @@ -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)