Selaa lähdekoodia

fix comment posting on thread

Bastien Sevajol (Algoo) 8 vuotta sitten
vanhempi
commit
1a0d947fc6
1 muutettua tiedostoa jossa 13 lisäystä ja 3 poistoa
  1. 13 3
      tracim/tracim/controllers/content.py

+ 13 - 3
tracim/tracim/controllers/content.py Näytä tiedosto

572
 
572
 
573
     @tg.require(current_user_is_reader())
573
     @tg.require(current_user_is_reader())
574
     @tg.expose('tracim.templates.thread.getone')
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
         thread_id = int(thread_id)
582
         thread_id = int(thread_id)
577
         user = tmpl_context.current_user
583
         user = tmpl_context.current_user
578
         workspace = tmpl_context.workspace
584
         workspace = tmpl_context.workspace
589
 
595
 
590
         dictified_thread = Context(CTX.THREAD).toDict(thread, 'thread')
596
         dictified_thread = Context(CTX.THREAD).toDict(thread, 'thread')
591
 
597
 
592
-        if inverted:
598
+        if kwargs.get('inverted'):
593
           dictified_thread.thread.history = reversed(dictified_thread.thread.history)
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