summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2012-05-04 10:03:37 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2012-05-04 10:03:37 (GMT)
commite45e851dab400376a7f981450dc59cb83d3745a4 (patch)
tree0c9576e64515e1ba3bafbdbdc8173b44da51992d
parent3ba6167f342d26aac2211dc9c61dd76d1d00ed16 (diff)
downloadtabellio.pcfdb-e45e851dab400376a7f981450dc59cb83d3745a4.zip
tabellio.pcfdb-e45e851dab400376a7f981450dc59cb83d3745a4.tar.gz
tabellio.pcfdb-e45e851dab400376a7f981450dc59cb83d3745a4.tar.bz2
skip (and remove if existing) questions with title as q + numbers (#1224)
-rw-r--r--tabellio/pcfdb/sync.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tabellio/pcfdb/sync.py b/tabellio/pcfdb/sync.py
index 3bb5550..1948f74 100644
--- a/tabellio/pcfdb/sync.py
+++ b/tabellio/pcfdb/sync.py
@@ -1092,11 +1092,16 @@ class SyncFromPcfDbView(BrowserView):
count += 1
dos_id, state, dostype, sess, no, intit, authors, polgroups, topics = row
log.debug('t_qx/dos id: %s', dos_id)
+
+ if intit and '\n' in intit:
+ intit = intit.replace('\n', ' ').replace('\r', '')
+ if re.match('q[0-9]+$', intit):
+ if hasattr(self.questions_folder, dos_id):
+ self.questions_folder.manage_delObjects(dos_id)
+ continue
if not hasattr(self.questions_folder, dos_id):
self.questions_folder.invokeFactory('tabellio.documents.question', dos_id)
object = getattr(self.questions_folder, dos_id)
- if intit and '\n' in intit:
- intit = intit.replace('\n', ' ').replace('\r', '')
object.title = intit
object.session = sess
object.state = state