Browse Source

Hide deleted workspaces from the left tree view

root 10 years ago
parent
commit
771a3374a9
1 changed files with 2 additions and 2 deletions
  1. 2 2
      tracim/tracim/lib/workspace.py

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

@@ -69,7 +69,7 @@ class WorkspaceApi(object):
69 69
         return self._base_query().all()
70 70
 
71 71
     def get_all_for_user(self, user: User):
72
-        workspaces = [role.workspace for role in user.roles]
72
+        workspaces = [role.workspace for role in user.roles if not role.workspace.is_deleted]
73 73
         workspaces.sort(key=lambda workspace: workspace.label.lower())
74 74
         return workspaces
75 75
 
@@ -108,4 +108,4 @@ class WorkspaceApi(object):
108 108
         if flush:
109 109
             DBSession.flush()
110 110
 
111
-        return workspace
111
+        return workspace