X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Fmanageuserview.py;h=7687d341fede606246b86d1f30e15121964e928f;hb=4ad60d7dc184fdaf572c6d818a3bfc4bcbacbf30;hp=4f5c72ffa673cb75d934888504200781bd603b36;hpb=faff7d4312753dcd49eab496884bcbf0483f17c7;p=unfold.git diff --git a/portal/manageuserview.py b/portal/manageuserview.py index 4f5c72ff..7687d341 100644 --- a/portal/manageuserview.py +++ b/portal/manageuserview.py @@ -10,8 +10,7 @@ from ui.topmenu import topmenu_items_live, the_user from django.http import HttpResponse, HttpResponseRedirect from django.contrib import messages from django.contrib.auth.decorators import login_required -from django.core.mail import send_mail -from theme import ThemeView +from myslice.theme import ThemeView # import json, os, re, itertools @@ -262,42 +261,37 @@ def user_process(request, **kwargs): 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 - - - + # 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 + if 'submit_name' in request.POST: edited_first_name = request.POST['fname'] edited_last_name = request.POST['lname']