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