+ # Delete reference account from the platforms
+ if 'delete_'+platform_detail['platform'] in request.POST:
+ platform_id = platform_detail['platform_id']
+ user_params = {'user_id':user_id}
+ manifold_delete_account(request,platform_id, user_id, user_params)
+ messages.info(request, 'Reference Account is removed from the selected platform')
+ return HttpResponseRedirect("/portal/account/")
+
+ if platform_detail['platform_id'] == account_detail['platform_id']:
+ if 'myslice' in platform_detail['platform']:
+ account_config = json.loads(account_detail['config'])
+ acc_slice_cred = account_config.get('delegated_slice_credentials','N/A')
+ acc_auth_cred = account_config.get('delegated_authority_credentials','N/A')
+
+
+
+
+ # adding the slices and corresponding credentials to list
+ if 'N/A' not in acc_slice_cred:
+ slice_list = []
+ slice_cred = []
+ for key, value in acc_slice_cred.iteritems():
+ slice_list.append(key)
+ slice_cred.append(value)
+ # special case: download each slice credentials separately
+ for i in range(0, len(slice_list)):
+ if 'dl_'+slice_list[i] in request.POST:
+ slice_detail = "Slice name: " + slice_list[i] +"\nSlice Credentials: \n"+ slice_cred[i]
+ response = HttpResponse(slice_detail, content_type='text/plain')
+ response['Content-Disposition'] = 'attachment; filename="slice_credential.txt"'
+ return response
+
+ # adding the authority and corresponding credentials to list
+ if 'N/A' not in acc_auth_cred:
+ auth_list = []
+ auth_cred = []
+ for key, value in acc_auth_cred.iteritems():
+ auth_list.append(key)
+ auth_cred.append(value)
+ # special case: download each slice credentials separately
+ for i in range(0, len(auth_list)):
+ if 'dl_'+auth_list[i] in request.POST:
+ auth_detail = "Authority: " + auth_list[i] +"\nAuthority Credentials: \n"+ auth_cred[i]
+ response = HttpResponse(auth_detail, content_type='text/plain')
+ response['Content-Disposition'] = 'attachment; filename="auth_credential.txt"'
+ return response
+
+
+