Commit 9b4a93862813d950838103ca4594f9e3cc1f70b3

Fix edit routes returning wrong document version number
timApp/routes/edit.py
(2 / 1)
  
317317 edit_request: Optional[EditRequest]=None,
318318 edit_result: Optional[DocumentEditResult]=None):
319319 current_user = get_current_user_object()
320 new_doc_version = doc.get_version()
320321 if update_cache:
321322 changed_pars = DocParagraph.preload_htmls(doc.get_paragraphs(include_preamble=True),
322323 doc.get_settings(),
376376 text=[p],
377377 item={'rights': get_rights(doc.doc_id)}) for p in
378378 changed_pars},
379 'version': doc.get_version(),
379 'version': new_doc_version,
380380 'duplicates': duplicates,
381381 'original_par': {'md': original_par.get_markdown(),
382382 'attrs': original_par.get_attrs()} if original_par else None,
timApp/tests/server/test_editing.py
(6 / 0)
  
185185 self.post_par(d.document, md1 + md2, par_id=par1.get_id(), expect_status=400,
186186 expect_content={'error': f'Duplicate paragraph id(s): {par2.get_id()}'})
187187 self.get(d.url)
188
189 def test_version(self):
190 self.login_test1()
191 d = self.create_doc()
192 j = self.new_par(d.document, 'test')
193 self.assertEqual(j['version'], [1, 0])