summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2014-09-19 10:06:07 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2014-09-19 10:06:07 (GMT)
commit3d9b3b58fcb3ab19b2aa6acf36cdf00793f2456b (patch)
treeb28f8d5f1051b249f0c027fd56cdb55b64b8ad0f
parentb439e031adbadcb5979381640c1f8f393c53dcc4 (diff)
downloadtabellio.pcfdb-3d9b3b58fcb3ab19b2aa6acf36cdf00793f2456b.zip
tabellio.pcfdb-3d9b3b58fcb3ab19b2aa6acf36cdf00793f2456b.tar.gz
tabellio.pcfdb-3d9b3b58fcb3ab19b2aa6acf36cdf00793f2456b.tar.bz2
do not abort on meetings on unknown commissions (#5543)
-rw-r--r--tabellio/pcfdb/sync.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tabellio/pcfdb/sync.py b/tabellio/pcfdb/sync.py
index bce222c..15f6f9c 100644
--- a/tabellio/pcfdb/sync.py
+++ b/tabellio/pcfdb/sync.py
@@ -238,7 +238,10 @@ class SyncFromPcfDbView(BrowserView):
cat_id = self.plone_utils.normalizeString(category)
folder = getattr(self.commissions_folder, cat_id)
code_id = self.plone_utils.normalizeString(code)
- obj = getattr(folder, code_id)
+ try:
+ obj = getattr(folder, code_id)
+ except AttributeError:
+ return None
self._commissions[com_id] = obj
return obj
@@ -1305,6 +1308,9 @@ class SyncFromPcfDbView(BrowserView):
commission = None
if comid:
commission = self.get_commission(comid)
+ if commission is None:
+ log.warning('invalid commission for reunion, (comid: %s, reu_id: %s)', comid, reu_id)
+ continue
if datedeb:
if heuredeb: