Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab
[myslice.git] / portal / projectrequestview.py
index 086d60c..37442f1 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 self.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
@@ -139,8 +142,10 @@ class ProjectRequestView(LoginRequiredAutoLogoutView, ThemeView):
                 if is_pi(wsgi_request, user_hrn, user_authority):
                     # PIs can directly create/join project in their own authority...
                     if 'join' in wsgi_request.POST:
+                        # join existing project
                         authority_add_pis(wsgi_request, post['project_name'], user_hrn)
                     else:
+                        # Create project
                         hrn = post['authority_hrn'] + '.' + post['project_name']
                         sfa_add_authority(wsgi_request, {'authority_hrn':hrn})
                         authority_add_pis(wsgi_request, hrn, user_hrn)