Browse Source

Drops deleted workspace roles from /admin/users/ (#407)

algooapy 6 years ago
parent
commit
dd78323bf3

+ 1 - 0
tracim/tracim/model/serializers.py View File

@@ -979,6 +979,7 @@ def serialize_workspace_default(workspace: Workspace, context: Context):
979 979
         id = workspace.workspace_id,
980 980
         label = workspace.label,  # FIXME - 2015-08-20 - remove this property
981 981
         name = workspace.label,  # use name instead of label
982
+        is_deleted=workspace.is_deleted,
982 983
         url = context.url('/workspaces/{}'.format(workspace.workspace_id))
983 984
     )
984 985
     return result

+ 2 - 0
tracim/tracim/templates/admin/user_getone.mak View File

@@ -75,11 +75,13 @@
75 75
                         </tr>
76 76
                     </thead>
77 77
                     % for role in result.user.roles:
78
+                        % if not role.workspace.is_deleted:
78 79
                         <%
79 80
                             enable_link = '/admin/users/{user}/workspaces/{workspace}/enable_notifications?next_url=/admin/users/{user}'
80 81
                             disable_link = '/admin/users/{user}/workspaces/{workspace}/disable_notifications?next_url=/admin/users/{user}'
81 82
                         %>
82 83
                         ${TABLE_ROW.USER_ROLE_IN_WORKSPACE(fake_api.current_user, role, show_id=True, enable_link=enable_link, disable_link=disable_link)}
84
+                        % endif
83 85
                     % endfor
84 86
                 </table>
85 87
             % endif