do not fail in case of missing author
This commit is contained in:
parent
1c0829f7ba
commit
fcd7896a87
|
@ -15,7 +15,7 @@ class BasePublication(object):
|
|||
def get_authors_as_string(self):
|
||||
if not self.authors:
|
||||
return ''
|
||||
return ', '.join([x.to_object.title for x in self.authors])
|
||||
return ', '.join([x.to_object.title for x in self.authors if x.to_object])
|
||||
|
||||
@property
|
||||
def authors_html_str(self):
|
||||
|
@ -23,6 +23,7 @@ class BasePublication(object):
|
|||
return ''
|
||||
t = []
|
||||
for x in self.authors:
|
||||
if x.to_object is None: continue
|
||||
url = x.to_object.absolute_url()
|
||||
if 'ministres' in url:
|
||||
t.append(u'%s' % x.to_object.title)
|
||||
|
|
Reference in New Issue