- # The form has been submitted
- form = SliceRequestForm(request.POST, initial=self.authority_hrn_initial(request))
-
- if form.is_valid():
- slice_name = form.cleaned_data['slice_name']
- authority_hrn = form.cleaned_data['authority_hrn']
- number_of_nodes = form.cleaned_data['number_of_nodes']
- type_of_nodes = form.cleaned_data['type_of_nodes']
- purpose = form.cleaned_data['purpose']
+ account_query = Query().get('local:account').select('user_id','platform_id','auth_type','config')
+ account_details = execute_query(wsgi_request, account_query)
+
+ platform_query = Query().get('local:platform').select('platform_id','platform','gateway_type','disabled')
+ platform_details = execute_query(wsgi_request, platform_query)
+ user_hrn = None
+ #getting user_hrn from local:account
+ for account_detail in account_details:
+ for platform_detail in platform_details:
+ if platform_detail['platform_id'] == account_detail['platform_id']:
+ # taking user_hrn only from myslice account
+ # NOTE: we should later handle accounts filter_by auth_type= managed OR user
+ if 'myslice' in platform_detail['platform']:
+ account_config = json.loads(account_detail['config'])
+ user_hrn = account_config.get('user_hrn','N/A')
+ # acc_auth_cred = account_config.get('delegated_authority_credentials','N/A')
+
+
+ # checking if pi or not
+ #if acc_auth_cred == {} or acc_auth_cred == 'N/A':
+ # pi = "is_not_pi"
+ #else:
+ # pi = "is_pi"
+
+ pi = authority_check_pis (wsgi_request, user_email)
+
+ # Page rendering
+ 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
+
+ # get the domain url
+ current_site = Site.objects.get_current()
+ current_site = current_site.domain