- b = PendingUser(
- first_name = reg_fname,
- last_name = reg_lname,
- authority_hrn = reg_auth,
- email = reg_email,
- password = reg_password,
- keypair = account_config,
- pi = reg_auth,
- )
- b.save()
+ salt = randint(1,100000)
+ # get the domain url
+ current_site = Site.objects.get_current()
+ current_site = current_site.domain
+
+ email_hash = md5(str(salt)+reg_email).hexdigest()
+ user_request = {
+ 'first_name' : reg_fname,
+ 'last_name' : reg_lname,
+ 'organization' : reg_site_name,
+ 'authority_hrn' : reg_auth,
+ 'email' : reg_email,
+ 'password' : reg_password,
+ 'public_key' : public_key,
+ 'private_key' : private_key,
+ 'current_site' : current_site,
+ 'email_hash' : email_hash,
+ 'user_hrn' : user_hrn,
+ 'pi' : [reg_auth],
+ 'auth_type' : 'managed',
+ 'validation_link': 'http://' + current_site + '/portal/email_activation/'+ email_hash
+ }