From: Yasin Date: Thu, 18 Sep 2014 14:30:44 +0000 (+0200) Subject: NoCreds: Warning Msg visible in Dashboard X-Git-Tag: myslice-1.2~1^2~27 X-Git-Url: http://git.onelab.eu/?p=unfold.git;a=commitdiff_plain;h=111cef56b76272a20082a32bb0e02d04700f0267 NoCreds: Warning Msg visible in Dashboard --- diff --git a/portal/homeview.py b/portal/homeview.py index 7af47760..35037876 100644 --- a/portal/homeview.py +++ b/portal/homeview.py @@ -80,13 +80,22 @@ class HomeView (FreeAccessView, ThemeView): account_config = json.loads(account_detail['config']) if 'myslice' in platform_detail['platform']: acc_auth_cred = account_config.get('delegated_authority_credentials','N/A') + acc_user_cred = account_config.get('delegated_user_credential','N/A') # assigning values if acc_auth_cred=={} or acc_auth_cred=='N/A': pi = "is_not_pi" else: pi = "is_pi" - env['pi'] = pi + # check if the user has creds or not + if acc_user_cred == {} or acc_user_cred == 'N/A': + user_cred = 'no_creds' + else: + user_cred = 'has_creds' + + + env['pi'] = pi + env['user_cred'] = user_cred else: env['person'] = None return render_to_response(self.template,env, context_instance=RequestContext(request)) @@ -123,13 +132,22 @@ class HomeView (FreeAccessView, ThemeView): account_config = json.loads(account_detail['config']) if 'myslice' in platform_detail['platform']: acc_auth_cred = account_config.get('delegated_authority_credentials','N/A') + acc_user_cred = account_config.get('delegated_user_credential','N/A') # assigning values if acc_auth_cred=={} or acc_auth_cred=='N/A': pi = "is_not_pi" else: pi = "is_pi" - env['pi'] = pi + # check if the user has creds or not + if acc_user_cred == {} or acc_user_cred == 'N/A': + user_cred = 'no_creds' + else: + user_cred = 'has_creds' + + + env['pi'] = pi + env['user_cred'] = user_cred env['person'] = self.request.user else: env['person'] = None diff --git a/portal/templates/onelab/onelab_account-view.html b/portal/templates/onelab/onelab_account-view.html index f138e3e6..199444a3 100644 --- a/portal/templates/onelab/onelab_account-view.html +++ b/portal/templates/onelab/onelab_account-view.html @@ -7,6 +7,10 @@ Account  >  {{ person.email }} + {%if 'no_creds' in user_cred %} +

NO CREDENTIALS are delegated to the portal!

+{%endif%} + {% if messages %}