X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Factions.py;h=ec4b2888335dc13de4d346b99baeffe517b8997f;hb=929f8979e42188a6dd7c7afed81342d4b1ef99e5;hp=aaa13b5413af77eaabc194875589fde5687a1e13;hpb=2a91f686e983547fcbc6ac4057025c26b6335667;p=unfold.git diff --git a/portal/actions.py b/portal/actions.py index aaa13b54..ec4b2888 100644 --- a/portal/actions.py +++ b/portal/actions.py @@ -81,10 +81,15 @@ def get_jfed_identity(request): return None def getAuthorities(request, admin = False): - result = sfa_client(request,'List',hrn='onelab',object_type='authority',platforms=['myslice'],admin=admin) + # XXX theme has to be the same as the root authority + result = sfa_client(request,'List',hrn=theme.theme,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) @@ -670,19 +675,17 @@ def portal_validate_request(wsgi_request, request_ids): elif request['type'] == 'authority': #hrn = "%s.%s" % (request['authority_hrn'], request['site_authority']) hrn = request['site_authority'] + name = request['site_name'] # XXX tmp sfa dependency from sfa.util.xrn import Xrn urn = Xrn(hrn, request['type']).get_urn() # Only hrn is required for Manifold Query sfa_authority_params = { - 'authority_hrn' : hrn, - #'authority_urn' : urn, - #'type' : request['type'], - #'pi' : None, - #'enabled' : True + 'authority_hrn' : hrn, + 'name' : name } - logger.info("ADD Authority") + #logger.info("ADD Authority") sfa_add_authority(wsgi_request, sfa_authority_params) request_status['SFA authority'] = {'status': True } a = PendingAuthority.objects.get(id=request['id'])