X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Factions.py;h=0e7c4c01e5dfc92149e27e9ad06324f801f9e2e4;hb=197e6f2843398a696d18f4eb0e13b7fa52d8fece;hp=0e003120d6b67d26ec7cb1246374b95e6b4250f3;hpb=832a69800ec6ef9463cd0d937d635fa59da6d803;p=unfold.git diff --git a/portal/actions.py b/portal/actions.py index 0e003120..0e7c4c01 100644 --- a/portal/actions.py +++ b/portal/actions.py @@ -84,7 +84,11 @@ def getAuthorities(request, admin = False): result = sfa_client(request,'List',hrn='onelab',object_type='authority',platforms=['myslice'],admin=admin) authorities = list() for item in result['myslice']: - authorities.append({'authority_hrn':item['hrn']}) + t_hrn = item['hrn'].split('.') + if 'name' in item: + authorities.append({'authority_hrn':item['hrn'], 'name':item['name'], 'shortname':t_hrn[-1].upper()}) + else: + authorities.append({'authority_hrn':item['hrn']}) return sorted(authorities) @@ -392,7 +396,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 +1298,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