Explorar el Código

Refactorise kwargs usage

Bastien Sevajol (Algoo) hace 8 años
padre
commit
c4b6e0f58b
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      tracim/tracim/controllers/content.py

+ 3 - 2
tracim/tracim/controllers/content.py Ver fichero

@@ -579,6 +579,7 @@ class UserWorkspaceFolderThreadRestController(TIMWorkspaceContentRestController)
579 579
                          NOTE: This parameter is in kwargs because prevent URL
580 580
                          changes.
581 581
         """
582
+        inverted = kwargs.get('inverted')
582 583
         thread_id = int(thread_id)
583 584
         user = tmpl_context.current_user
584 585
         workspace = tmpl_context.workspace
@@ -595,13 +596,13 @@ class UserWorkspaceFolderThreadRestController(TIMWorkspaceContentRestController)
595 596
 
596 597
         dictified_thread = Context(CTX.THREAD).toDict(thread, 'thread')
597 598
 
598
-        if kwargs.get('inverted'):
599
+        if inverted:
599 600
           dictified_thread.thread.history = reversed(dictified_thread.thread.history)
600 601
 
601 602
         return DictLikeClass(
602 603
             result=dictified_thread,
603 604
             fake_api=fake_api,
604
-            inverted=kwargs.get('inverted'),
605
+            inverted=inverted,
605 606
         )
606 607
 
607 608