NoCreds: Warning Msg visible in Dashboard
[unfold.git] / portal / homeview.py
index 7af4776..3503787 100644 (file)
@@ -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