X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Fslicerequestview.py;h=598aca3914f50e08b7aa09ed30d4f9c3ca5f0209;hb=57045d6382239cdd63454a419db7df89c913b139;hp=449147ca1642e2bd054afdf28d2327837485cad5;hpb=23d0b7e5a5f276eac75e518948fd8023c2798179;p=myslice.git diff --git a/portal/slicerequestview.py b/portal/slicerequestview.py index 449147ca..598aca39 100644 --- a/portal/slicerequestview.py +++ b/portal/slicerequestview.py @@ -34,6 +34,7 @@ class SliceRequestView (LoginRequiredAutoLogoutView, ThemeView): slice_name ='' purpose='' exp_url='' + authority_hrn = None # Retrieve the list of authorities authorities_query = Query.get('authority').select('name', 'authority_hrn') authorities = execute_admin_query(wsgi_request, authorities_query) @@ -83,6 +84,7 @@ class SliceRequestView (LoginRequiredAutoLogoutView, ThemeView): page = Page(wsgi_request) page.add_js_files ( [ "js/jquery.validate.js", "js/jquery-ui.js" ] ) page.add_css_files ( [ "https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" ] ) + page.expose_js_metadata() if method == 'POST': # The form has been submitted @@ -92,12 +94,13 @@ class SliceRequestView (LoginRequiredAutoLogoutView, ThemeView): current_site = current_site.domain # getting the authority_hrn from the selected organization - authority_hrn = '' for authority in authorities: if authority['name'] == wsgi_request.POST.get('org_name', ''): authority_hrn = authority['authority_hrn'] - + # Handle the case when the template uses only hrn and not name + if authority_hrn is None: + authority_hrn = wsgi_request.POST.get('org_name', '') slice_request = { 'type' : 'slice', @@ -168,6 +171,7 @@ class SliceRequestView (LoginRequiredAutoLogoutView, ThemeView): 'exp_url': exp_url, 'pi': pi, 'authority_name': authority_name, + 'authority_hrn': user_authority, 'cc_myself': True, 'authorities': authorities, 'theme': self.theme,