Browse Source

fixes the new treeview content root call

root 10 years ago
parent
commit
6cca21edb7
1 changed files with 2 additions and 2 deletions
  1. 2 2
      tracim/tracim/controllers/workspace.py

+ 2 - 2
tracim/tracim/controllers/workspace.py View File

@@ -89,7 +89,7 @@ class UserWorkspaceRestController(TIMRestController):
89 89
         workspace, content = convert_id_into_instances(current_id)
90 90
 
91 91
         # The following step allow to select the parent folder when content itself is not visible in the treeview
92
-        if content.type!=ContentType.Folder and CFG.CST.TREEVIEW_ALL!=CFG.get_instance().WEBSITE_TREEVIEW_CONTENT:
92
+        if content and content.type!=ContentType.Folder and CFG.CST.TREEVIEW_ALL!=CFG.get_instance().WEBSITE_TREEVIEW_CONTENT:
93 93
             content = content.parent if content.parent else None
94 94
 
95 95
         # This is the init of the recursive-like build of the tree
@@ -201,4 +201,4 @@ class UserWorkspaceRestController(TIMRestController):
201 201
     def _get_treeviewable_content_types_or_none(self):
202 202
         if CFG.get_instance().WEBSITE_TREEVIEW_CONTENT==CFG.CST.TREEVIEW_ALL:
203 203
             return ContentType.Any
204
-        return None # None means "workspaces and folders"
204
+        return None # None means "workspaces and folders"