From 5bad5f0a64a1ee1ad0f924870b1610c3add17834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 17 Jan 2012 13:50:13 +0100 Subject: [PATCH] do not linkify authors that are not deputies --- tabellio/documents/common.py | 10 ++++++++-- tabellio/documents/dossier.py | 11 ++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/tabellio/documents/common.py b/tabellio/documents/common.py index 6bb7a57..b36c63c 100644 --- a/tabellio/documents/common.py +++ b/tabellio/documents/common.py @@ -18,8 +18,14 @@ class BasePublication(object): def authors_html_str(self): if not self.authors: return '' - return ', '.join([u'%s' % (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'%s' % (url, x.to_object.title)) + return ', '.join(t) @property def topic_titles(self): diff --git a/tabellio/documents/dossier.py b/tabellio/documents/dossier.py index 6611b67..dfe6220 100644 --- a/tabellio/documents/dossier.py +++ b/tabellio/documents/dossier.py @@ -71,9 +71,14 @@ class HistoLine(Field): def authors_html_str(self): if not self.authors: return '' - return ', '.join([u'%s' % (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'%s' % (url, x.to_object.title)) + return ', '.join(t) @property def doc_pages_url(self):