MyAcc: interface visibility depends on user_status
authorYasin <mohammed-yasin.rahman@lip6.fr>
Fri, 31 Jan 2014 13:41:11 +0000 (14:41 +0100)
committerYasin <mohammed-yasin.rahman@lip6.fr>
Fri, 31 Jan 2014 13:41:11 +0000 (14:41 +0100)
portal/accountview.py
portal/templates/account-view.html

index c06f578..f366555 100644 (file)
@@ -185,6 +185,7 @@ class AccountView(LoginRequiredAutoLogoutView):
         context['my_users'] = my_users
         context['my_slices'] = my_slices
         context['my_auths'] = my_auths
+        context['user_status'] = user_status
         context['person']   = self.request.user
         context['firstname'] = config.get('firstname',"?")
         context['lastname'] = config.get('lastname',"?")
@@ -337,9 +338,9 @@ def account_process(request):
                         user_params = { 'config': keypair, 'auth_type':'managed'}
                         manifold_update_account(request,user_params)
                         # updating sfa
-                        public_key = public_key.replace('"', '');
-                        user_pub_key = {'keys': public_key}
-                        sfa_update_user(request, user_hrn, user_pub_key)
+                        #public_key = public_key.replace('"', '');
+                        #user_pub_key = {'keys': public_key}
+                        #sfa_update_user(request, user_hrn, user_pub_key)
                         messages.success(request, 'Sucess: New Keypair Generated! Delegation of your credentials will be automatic.')
                         return HttpResponseRedirect("/portal/account/")
         else:
index 8f853e1..74a2a0f 100644 (file)
 
 
 
-
+{%if 'Enabled'  in user_status %}
 <h3 id="show-pending" class="plugin-show" style="display: block;">
 <span class="glyphicon glyphicon-chevron-right"></span>
 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Show plugin &quot;Pending operations&quot; (QueryUpdater)"></a>Credentials</h3>
     </div>
 </div>
 </div>
+{%endif%} 
 
 </form>