Browse Source

fix comment posting on thread

Bastien Sevajol (Algoo) 8 years ago
parent
commit
1a0d947fc6
1 changed files with 13 additions and 3 deletions
  1. 13 3
      tracim/tracim/controllers/content.py

+ 13 - 3
tracim/tracim/controllers/content.py View File

@@ -572,7 +572,13 @@ class UserWorkspaceFolderThreadRestController(TIMWorkspaceContentRestController)
572 572
 
573 573
     @tg.require(current_user_is_reader())
574 574
     @tg.expose('tracim.templates.thread.getone')
575
-    def get_one(self, thread_id, inverted: str=''):
575
+    def get_one(self, thread_id, **kwargs):
576
+        """
577
+        :param thread_id: content_id of Thread
578
+        :param inverted: fill with True equivalent to invert order of comments
579
+                         NOTE: This parameter is in kwargs because prevent URL
580
+                         changes.
581
+        """
576 582
         thread_id = int(thread_id)
577 583
         user = tmpl_context.current_user
578 584
         workspace = tmpl_context.workspace
@@ -589,10 +595,14 @@ class UserWorkspaceFolderThreadRestController(TIMWorkspaceContentRestController)
589 595
 
590 596
         dictified_thread = Context(CTX.THREAD).toDict(thread, 'thread')
591 597
 
592
-        if inverted:
598
+        if kwargs.get('inverted'):
593 599
           dictified_thread.thread.history = reversed(dictified_thread.thread.history)
594 600
 
595
-        return DictLikeClass(result=dictified_thread, fake_api=fake_api, inverted=inverted)
601
+        return DictLikeClass(
602
+            result=dictified_thread,
603
+            fake_api=fake_api,
604
+            inverted=kwargs.get('inverted'),
605
+        )
596 606
 
597 607
 
598 608