skip (and remove if existing) questions with title as q + numbers (#1224)
This commit is contained in:
parent
3ba6167f34
commit
e45e851dab
|
@ -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
|
||||
|
|
Reference in New Issue