summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2019-05-27 12:22:46 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2019-05-27 12:22:46 (GMT)
commitd07ee2e4d9d54291372aa1db727ac86724892598 (patch)
treee49aacb9d2c6a90eb3fa83d51dd0c39fe58fa68d
parent04b953414c5207c8c65e9f9ed4bae0fadfd4605d (diff)
downloadtabellio.pcfdb-d07ee2e4d9d54291372aa1db727ac86724892598.zip
tabellio.pcfdb-d07ee2e4d9d54291372aa1db727ac86724892598.tar.gz
tabellio.pcfdb-d07ee2e4d9d54291372aa1db727ac86724892598.tar.bz2
handle having no secretaire
-rw-r--r--tabellio/pcfdb/sync.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/tabellio/pcfdb/sync.py b/tabellio/pcfdb/sync.py
index cc5eb19..33ca505 100644
--- a/tabellio/pcfdb/sync.py
+++ b/tabellio/pcfdb/sync.py
@@ -1468,12 +1468,13 @@ class SyncFromPcfDbView(BrowserView):
for vicepresident in vicepresidents:
table += u'<tr><td>%s</td><td>%s</td></tr>' % (
vicepresident[0], get_link(vicepresident[1], vicepresident[2]))
- secretaire = secretaires[0]
- table += u'<tr><td>Secrétaires du Parlement</td><td><ul>'
- if len(secretaires) > 1:
- for secretaire in secretaires[:-1]:
- table += '<li>%s</li>' % get_link(secretaire[1], secretaire[2])
- table += u'<li>%s</li></ul></td></tr>' % get_link(secretaires[-1][1], secretaires[-1][2])
+ if secretaires:
+ secretaire = secretaires[0]
+ table += u'<tr><td>Secrétaires du Parlement</td><td><ul>'
+ if len(secretaires) > 1:
+ for secretaire in secretaires[:-1]:
+ table += '<li>%s</li>' % get_link(secretaire[1], secretaire[2])
+ table += u'<li>%s</li></ul></td></tr>' % get_link(secretaires[-1][1], secretaires[-1][2])
conf_pres_table = table
table += u'''<tr><td>Greffier (Secrétaire général)</td>