From: Loic Baron Date: Thu, 28 May 2015 12:52:38 +0000 (+0200) Subject: Add user account returns user_id and is used in actions.py, fixed session in manage... X-Git-Tag: myslice-1.5~23 X-Git-Url: http://git.onelab.eu/?p=unfold.git;a=commitdiff_plain;h=2a91f686e983547fcbc6ac4057025c26b6335667 Add user account returns user_id and is used in actions.py, fixed session in manage user --- diff --git a/portal/actions.py b/portal/actions.py index 0e003120..aaa13b54 100644 --- a/portal/actions.py +++ b/portal/actions.py @@ -392,7 +392,7 @@ def manifold_add_user(wsgi_request, request): if not results: raise Exception, "Failed creating manifold user: %s" % user_params['email'] result = results[0] - return result['email'] + return result['user_id'] def manifold_update_user(request, email, user_params): # user_params: password, config e.g., @@ -1294,8 +1294,6 @@ def create_pending_user(wsgi_request, request, user_detail): if request['private_key']: account_config['user_private_key'] = request['private_key'] - user_id = user_detail['user_id'] + 1 # the user_id for the newly created user in local:user - # XXX TODO: Require a myslice platform # ALERT: this will disapear with ROUTERV2 of Manifold # We have to consider the case where several registries can be used diff --git a/portal/manageuserview.py b/portal/manageuserview.py index c93739fd..bbe50942 100644 --- a/portal/manageuserview.py +++ b/portal/manageuserview.py @@ -195,7 +195,7 @@ class UserView(LoginRequiredAutoLogoutView, ThemeView): for t in itertools.izip_longest(total_platform_list)] ## check pi or no - pi_status = request.session['user']['pi'] + pi_status = self.request.session['user']['pi'] context = super(UserView, self).get_context_data(**kwargs) context['principal_acc'] = principal_acc_list