From: Yasin Date: Fri, 15 Nov 2013 11:33:17 +0000 (+0100) Subject: Registration: user_hrn generated based on authority+email X-Git-Tag: myslice-0.3-0~113^2~7^2~7^2~6 X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=commitdiff_plain;h=45246794827d986ef13930f8bf476754beeb5765 Registration: user_hrn generated based on authority+email --- diff --git a/portal/registrationview.py b/portal/registrationview.py index e27dfb4d..aebe1817 100644 --- a/portal/registrationview.py +++ b/portal/registrationview.py @@ -63,7 +63,11 @@ class RegistrationView (FreeAccessView): reg_auth = request.POST.get('authority_hrn', '') reg_login = request.POST.get('login', '') reg_email = request.POST.get('email','').lower() - + #prepare user_hrn + split_email = reg_email.split("@")[0] + split_email = split_email.replace(".", "_") + user_hrn = reg_auth + '.' + split_email + #POST value validation if (re.search(r'^[\w+\s.@+-]+$', reg_fname)==None): errors.append('First Name may contain only letters, numbers, spaces and @/./+/-/_ characters.') @@ -89,7 +93,7 @@ class RegistrationView (FreeAccessView): # private_key = ''.join(private_key.split()) # public_key = "ssh-rsa " + public_key # Saving to DB - keypair = '{"user_public_key":'+ public_key + ', "user_private_key":'+ private_key + '}' + keypair = '{"user_public_key":'+ public_key + ', "user_private_key":'+ private_key + ', "user_hrn":'+ user_hrn + '}' #keypair = re.sub("\r", "", keypair) #keypair = re.sub("\n", "\\n", keypair) #keypair = keypair.rstrip('\r\n')