summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2015-04-20 09:42:46 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2015-04-20 11:39:34 (GMT)
commit8784ac182e2660d9e7a1be9e7af464ec7a9654e8 (patch)
tree75a77c116dd31562d8320235f2f046217aba2bd7
parent9a33766f31ddad6e627331dc776edcc3da966281 (diff)
downloadtabellio.pcfdb-8784ac182e2660d9e7a1be9e7af464ec7a9654e8.zip
tabellio.pcfdb-8784ac182e2660d9e7a1be9e7af464ec7a9654e8.tar.gz
tabellio.pcfdb-8784ac182e2660d9e7a1be9e7af464ec7a9654e8.tar.bz2
don't break on old commissions (#6984)
-rw-r--r--tabellio/pcfdb/sync.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tabellio/pcfdb/sync.py b/tabellio/pcfdb/sync.py
index ad59705..864b28c 100644
--- a/tabellio/pcfdb/sync.py
+++ b/tabellio/pcfdb/sync.py
@@ -252,6 +252,8 @@ class SyncFromPcfDbView(BrowserView):
if com_id in self._commission_intids:
return self._commission_intids.get(com_id)
obj = self.get_commission(com_id)
+ if obj is None:
+ return None
try:
intid = self.intids.getId(obj)
except KeyError:
@@ -1087,7 +1089,9 @@ class SyncFromPcfDbView(BrowserView):
object.authors = []
try:
- object.commissions = [RelationValue(self.get_commission_intid(x)) for x in curcom or []]
+ commission_ids = [self.get_commission_intid(x) for x in (curcom or []) if x not in ('001291649,')]
+ commission_ids = [x for x in commission_ids if x]
+ object.commissions = [RelationValue(x) for x in commission_ids]
except AttributeError:
pass