From 197e6f2843398a696d18f4eb0e13b7fa52d8fece Mon Sep 17 00:00:00 2001 From: Loic Baron Date: Tue, 9 Jun 2015 16:55:07 +0200 Subject: [PATCH] Registration using Names from Registry --- portal/actions.py | 6 +++++- portal/templates/registration_view.html | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/portal/actions.py b/portal/actions.py index aaa13b54..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) diff --git a/portal/templates/registration_view.html b/portal/templates/registration_view.html index b0bb14a1..ec90abf9 100644 --- a/portal/templates/registration_view.html +++ b/portal/templates/registration_view.html @@ -40,7 +40,7 @@ {% if authorities %} {% for authority in authorities %} {% if authority.name %} - + {% else %} {% endif %} -- 2.43.0