X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Fprojectrequestview.py;h=3d749c855291e95239a910eeefdfb21907b5d9f6;hb=cf0d90125ee5ee265e2eea3cb945f9d49964a5e6;hp=932c9ab19ae12511bd950c97ad9a7e799d6ffcf2;hpb=3efb1dc5f502a25a4e1ebe2e499eba3d7a94e127;p=unfold.git diff --git a/portal/projectrequestview.py b/portal/projectrequestview.py index 932c9ab1..3d749c85 100644 --- a/portal/projectrequestview.py +++ b/portal/projectrequestview.py @@ -20,13 +20,17 @@ 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('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 matching = [s for s in authorities if "." in s['authority_hrn']] authorities = sorted(matching, key=lambda k: k['authority_hrn']) - authorities = sorted(matching, key=lambda k: k['name']) + if self.theme != 'fed4fire': + authorities = sorted(matching, key=lambda k: k['name']) return authorities def getUserAuthority(self, request): @@ -87,9 +91,9 @@ class ProjectRequestView(LoginRequiredAutoLogoutView, ThemeView): user_authority = self.getUserAuthority(wsgi_request) # getting the org from authority - for authority in authorities: - if authority['authority_hrn'] == user_authority: - authority_name = authority['name'] + #for authority in authorities: + # if authority['authority_hrn'] == user_authority: + # authority_name = authority['name'] if method == 'POST' : @@ -136,7 +140,7 @@ class ProjectRequestView(LoginRequiredAutoLogoutView, ThemeView): if not errors: logger.info("is_pi on auth_hrn = {}".format(user_authority)) - if is_pi(wsgi_request, user_hrn, user_authority): + if is_pi(wsgi_request, user_hrn, post['authority_hrn']): # PIs can directly create/join project in their own authority... if 'join' in wsgi_request.POST: # join existing project