summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2019-05-27 12:26:29 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2019-05-27 12:26:29 (GMT)
commit4ddb26f6def9c32e10f325189f1ab6272ef44b7f (patch)
tree50016d10f76ef1796ec0afa9663ac144c15931b9
parentd07ee2e4d9d54291372aa1db727ac86724892598 (diff)
downloadtabellio.pcfdb-4ddb26f6def9c32e10f325189f1ab6272ef44b7f.zip
tabellio.pcfdb-4ddb26f6def9c32e10f325189f1ab6272ef44b7f.tar.gz
tabellio.pcfdb-4ddb26f6def9c32e10f325189f1ab6272ef44b7f.tar.bz2
handle having no group presidents (#33438)
-rw-r--r--tabellio/pcfdb/sync.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/tabellio/pcfdb/sync.py b/tabellio/pcfdb/sync.py
index 33ca505..0c14438 100644
--- a/tabellio/pcfdb/sync.py
+++ b/tabellio/pcfdb/sync.py
@@ -1518,13 +1518,14 @@ class SyncFromPcfDbView(BrowserView):
nom, prenom, description = row
presgroups.append((description, nom, prenom))
- presgroup = presgroups[0]
- table = conf_pres_table
- table += u'<tr><td>Présidents de groupe</td><td><ul>'
- if len(presgroups) > 1:
- for presgroup in presgroups[:-1]:
- table += u'<li>%s</li>' % get_link(presgroup[1], presgroup[2])
- table += u'<li>%s</li></ul></td></tr>' % get_link(presgroups[-1][1], presgroups[-1][2])
+ if presgroups:
+ presgroup = presgroups[0]
+ table = conf_pres_table
+ table += u'<tr><td>Présidents de groupe</td><td><ul>'
+ if len(presgroups) > 1:
+ for presgroup in presgroups[:-1]:
+ table += u'<li>%s</li>' % get_link(presgroup[1], presgroup[2])
+ table += u'<li>%s</li></ul></td></tr>' % get_link(presgroups[-1][1], presgroups[-1][2])
table += u'<tr><td>Greffier (Secrétaire général)</td><td>%s</td></tr>' % self.settings.greffier_name