Join project: optimize queries
authorLoic Baron <loic.baron@lip6.fr>
Thu, 23 Apr 2015 12:28:18 +0000 (14:28 +0200)
committerLoic Baron <loic.baron@lip6.fr>
Thu, 23 Apr 2015 12:28:18 +0000 (14:28 +0200)
portal/projectrequestview.py
portal/templates/fed4fire/fed4fire_projectrequest_view.html

index 932c9ab..13c4960 100644 (file)
@@ -20,7 +20,10 @@ class ProjectRequestView(LoginRequiredAutoLogoutView, ThemeView):
     template_name = 'projectrequest_view.html'
     
     def getAuthorities(self, request):
-        authorities_query = Query.get('authority').select('name', 'authority_hrn')
+        if theme.theme == 'fed4fire':
+            authorities_query = Query.get('myslice:authority').select('name', 'authority_hrn')
+        else:
+            authorities_query = Query.get('authority').select('name', 'authority_hrn')
         authorities = execute_admin_query(request, authorities_query)
         if authorities is not None:
             # Remove the root authority from the list
index 5daf0cc..fd23351 100644 (file)
@@ -166,7 +166,7 @@ $(document).ready(function() {
     });
 /*
        
-       $("#authority_hrn").load("/rest/user/", {"fields" : ["parent_authority"], "filters": {"user_hrn": "{{ user_hrn }}"}}, function(data) {
+       $("#authority_hrn").load("/rest/myslice:user/", {"fields" : ["parent_authority"], "filters": {"user_hrn": "{{ user_hrn }}"}}, function(data) {
                var jsonData = JSON.parse(data);
         $(this).attr("value", jsonData[0]['parent_authority']);
     });