From bb9c39314d0af084c7c54a5506183ad5dda2623a Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 14 Jul 2015 19:15:22 +0200 Subject: [PATCH] fix script title --- teleforma/exam/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/teleforma/exam/models.py b/teleforma/exam/models.py index 73951295..d87be17e 100644 --- a/teleforma/exam/models.py +++ b/teleforma/exam/models.py @@ -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) -- 2.39.5