X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Fprojectrequestview.py;h=3d749c855291e95239a910eeefdfb21907b5d9f6;hb=cf0d90125ee5ee265e2eea3cb945f9d49964a5e6;hp=37442f1165d6f2c18ba25a0a97b35514460da4f8;hpb=ced87c58450ab1d6ef59d5b631c2505db80a3887;p=unfold.git diff --git a/portal/projectrequestview.py b/portal/projectrequestview.py index 37442f11..3d749c85 100644 --- a/portal/projectrequestview.py +++ b/portal/projectrequestview.py @@ -21,7 +21,7 @@ class ProjectRequestView(LoginRequiredAutoLogoutView, ThemeView): def getAuthorities(self, request): if self.theme == 'fed4fire': - authorities_query = Query.get('myslice:authority').select('name', 'authority_hrn') + 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) @@ -29,7 +29,8 @@ class ProjectRequestView(LoginRequiredAutoLogoutView, ThemeView): # 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): @@ -90,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' : @@ -139,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