do not linkify authors that are not deputies

This commit is contained in:
Frédéric Péters 2012-01-17 13:50:13 +01:00
parent 8187d3a809
commit 5bad5f0a64
2 changed files with 16 additions and 5 deletions

View File

@ -18,8 +18,14 @@ class BasePublication(object):
def authors_html_str(self):
if not self.authors:
return ''
return ', '.join([u'<a href="%s">%s</a>' % (x.to_object.absolute_url(), x.to_object.title)
for x in self.authors])
t = []
for x in self.authors:
url = x.to_object.absolute_url()
if 'ministres' in url:
t.append(u'%s' % x.to_object.title)
else:
t.append(u'<a href="%s">%s</a>' % (url, x.to_object.title))
return ', '.join(t)
@property
def topic_titles(self):

View File

@ -71,9 +71,14 @@ class HistoLine(Field):
def authors_html_str(self):
if not self.authors:
return ''
return ', '.join([u'<a href="%s">%s</a>' % (x.to_object.absolute_url(), x.to_object.title)
for x in self.authors])
t = []
for x in self.authors:
url = x.to_object.absolute_url()
if 'ministres' in url:
t.append(u'%s' % x.to_object.title)
else:
t.append(u'<a href="%s">%s</a>' % (url, x.to_object.title))
return ', '.join(t)
@property
def doc_pages_url(self):