From 5bc5ebbb3fe574a5699c580594808cee44a4e0b3 Mon Sep 17 00:00:00 2001 From: lombardofr Date: Mon, 19 Aug 2019 09:33:56 +0200 Subject: [PATCH] fix bug 823; fix bug 800 Change-Id: Idafe6cd3ab8db26cb763be9f334809429dbec913 Signed-off-by: lombardofr --- authosm/models.py | 5 +- .../project/osm/osm_project_left_sidebar.html | 17 ++- projecthandler/views.py | 6 +- rolehandler/templates/modal/role_create.html | 29 ++-- rolehandler/templates/modal/role_edit.html | 28 ++-- rolehandler/views.py | 30 ++-- static/src/rolehandler/role_list.js | 2 +- static/src/userhandler/user_list.js | 141 +++++++++++++++++- template/base.html | 23 ++- userhandler/templates/modal/user_create.html | 36 ++++- ...r_edit.html => user_credentials_edit.html} | 36 ++++- .../templates/modal/user_proj_role_edit.html | 44 ++++++ userhandler/templates/user_list.html | 56 ++++--- userhandler/urls.py | 1 + userhandler/views.py | 63 ++++---- 15 files changed, 402 insertions(+), 115 deletions(-) rename userhandler/templates/modal/{user_edit.html => user_credentials_edit.html} (63%) create mode 100644 userhandler/templates/modal/user_proj_role_edit.html diff --git a/authosm/models.py b/authosm/models.py index f968dfa..74c1f1e 100644 --- a/authosm/models.py +++ b/authosm/models.py @@ -93,11 +93,10 @@ class AbstractOsmUser(AbstractBaseUser, PermissionsMixin): def get_projects(self): client = Client() user_info = client.get_user_info(self.get_token(), self.username) - projects = client.get_projects(self.get_token(), user_info['data']['projects']) - if 'error' in projects and projects['error'] is True: + if 'error' in user_info and user_info['error'] is True: return [] else: - return projects['data'] + return user_info['data']['project_role_mappings'] def switch_project(self, project_id): client = Client() diff --git a/projecthandler/template/project/osm/osm_project_left_sidebar.html b/projecthandler/template/project/osm/osm_project_left_sidebar.html index 7259834..a16d86e 100644 --- a/projecthandler/template/project/osm/osm_project_left_sidebar.html +++ b/projecthandler/template/project/osm/osm_project_left_sidebar.html @@ -1,3 +1,18 @@ +