From 19b7f04b7b06c4868664de63e3522da812510b9b Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Fri, 26 Jan 2018 09:43:40 +0100 Subject: [PATCH] Fix no script type --- teleforma/exam/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 2.39.5