From: Jordan Augé Date: Tue, 25 Mar 2014 16:58:44 +0000 (+0100) Subject: Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab X-Git-Tag: myslice-1.1~176^2 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=6b18097c8867ce4c5b7388e527926fd3054c3e64;hp=628919d89e98c72fc4ca73af2d99866d00e49b0e;p=unfold.git Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab --- diff --git a/portal/institution.py b/portal/institution.py index 30ef1867..6c55517d 100644 --- a/portal/institution.py +++ b/portal/institution.py @@ -53,11 +53,29 @@ class InstitutionView (FreeAccessView, ThemeView): env['user_details'] = {'parent_authority': user_local_authority} except Exception,e: env['error'] = "Please check your Manifold user config" + ## check user is pi or not + platform_query = Query().get('local:platform').select('platform_id','platform','gateway_type','disabled') + account_query = Query().get('local:account').select('user_id','platform_id','auth_type','config') + platform_details = execute_query(self.request, platform_query) + account_details = execute_query(self.request, account_query) + for platform_detail in platform_details: + for account_detail in account_details: + if platform_detail['platform_id'] == account_detail['platform_id']: + if 'config' in account_detail and account_detail['config'] is not '': + account_config = json.loads(account_detail['config']) + if 'myslice' in platform_detail['platform']: + acc_auth_cred = account_config.get('delegated_authority_credentials','N/A') + # assigning values + if acc_auth_cred == {}: + pi = "is_not_pi" + else: + pi = "is_pi" + else: env['person'] = None env['theme'] = self.theme - + env['pi'] = pi env['username']=the_user(request) env['topmenu_items'] = topmenu_items(None, request) if state: env['state'] = state diff --git a/portal/templates/about.html b/portal/templates/about.html index 4736ae66..1764fc42 100644 --- a/portal/templates/about.html +++ b/portal/templates/about.html @@ -37,7 +37,7 @@ your public key to support@myslice.info.

- Go to the MySlice web site + Go to the MySlice web site

diff --git a/portal/templates/account-view.html b/portal/templates/account-view.html index bd7269b8..353a83c2 100644 --- a/portal/templates/account-view.html +++ b/portal/templates/account-view.html @@ -253,7 +253,6 @@

{%endif%} -
@@ -302,6 +301,7 @@
{%endif%} +