From e45e851dab400376a7f981450dc59cb83d3745a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Fri, 4 May 2012 12:03:37 +0200 Subject: [PATCH] skip (and remove if existing) questions with title as q + numbers (#1224) --- tabellio/pcfdb/sync.py | 9 +++++++-- 1 file 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