Browse Source

code style

Guénaël Muller 6 years ago
parent
commit
5dd709ace8
2 changed files with 20 additions and 10 deletions
  1. 19 9
      tracim/tracim/controllers/content.py
  2. 1 1
      tracim/tracim/lib/webdav/__init__.py

+ 19 - 9
tracim/tracim/controllers/content.py View File

582
 
582
 
583
         tg.flash(_('Page created'), CST.STATUS_OK)
583
         tg.flash(_('Page created'), CST.STATUS_OK)
584
         redirect = '/workspaces/{}/folders/{}/pages/{}'
584
         redirect = '/workspaces/{}/folders/{}/pages/{}'
585
-        tg.redirect(tg.url(redirect).format(tmpl_context.workspace_id,
586
-                                            tmpl_context.folder_id,
587
-                                            page.content_id))
585
+        tg.redirect(tg.url(redirect).format(
586
+            tmpl_context.workspace_id,
587
+            tmpl_context.folder_id,
588
+            page.content_id)
589
+        )
588
 
590
 
589
     @tg.require(current_user_is_contributor())
591
     @tg.require(current_user_is_contributor())
590
     @tg.expose()
592
     @tg.expose()
615
             not_updated = '{} not updated: the content did not change'
617
             not_updated = '{} not updated: the content did not change'
616
             msg = _(not_updated).format(self._item_type_label)
618
             msg = _(not_updated).format(self._item_type_label)
617
             tg.flash(msg, CST.STATUS_WARNING)
619
             tg.flash(msg, CST.STATUS_WARNING)
618
-            tg.redirect(self._err_url.format(tmpl_context.workspace_id,
619
-                                             tmpl_context.folder_id,
620
-                                             item_id))
620
+            tg.redirect(
621
+                self._err_url.format(
622
+                    tmpl_context.workspace_id,
623
+                    tmpl_context.folder_id,
624
+                    item_id
625
+                )
626
+            )
621
         except ValueError as e:
627
         except ValueError as e:
622
             not_updated = '{} not updated - error: {}'
628
             not_updated = '{} not updated - error: {}'
623
             msg = _(not_updated).format(self._item_type_label, str(e))
629
             msg = _(not_updated).format(self._item_type_label, str(e))
624
             tg.flash(msg, CST.STATUS_ERROR)
630
             tg.flash(msg, CST.STATUS_ERROR)
625
-            tg.redirect(self._err_url.format(tmpl_context.workspace_id,
626
-                                             tmpl_context.folder_id,
627
-                                             item_id))
631
+            tg.redirect(
632
+                self._err_url.format(
633
+                    tmpl_context.workspace_id,
634
+                    tmpl_context.folder_id,
635
+                    item_id
636
+                )
637
+            )
628
 
638
 
629
 class UserWorkspaceFolderThreadRestController(TIMWorkspaceContentRestController):
639
 class UserWorkspaceFolderThreadRestController(TIMWorkspaceContentRestController):
630
     """
640
     """

+ 1 - 1
tracim/tracim/lib/webdav/__init__.py View File

12
 from tracim.model.data import ContentType
12
 from tracim.model.data import ContentType
13
 from tracim.model.data import Content
13
 from tracim.model.data import Content
14
 from tracim.model.data import Workspace
14
 from tracim.model.data import Workspace
15
-from wsgidav.dav_error import DAVError, HTTP_FORBIDDEN, HTTP_NOT_MODIFIED
15
+from wsgidav.dav_error import DAVError, HTTP_FORBIDDEN
16
 
16
 
17
 
17
 
18
 class HistoryType(object):
18
 class HistoryType(object):