+ authorities_query = Query.get('authority').select('name', 'authority_hrn')
+ authorities = execute_admin_query(wsgi_request, authorities_query)
+
+ for authority in authorities:
+ if authority['name'] == wsgi_request.POST.get('org_name', ''):
+ authority_hrn = authority['authority_hrn']
+
+ post_email = wsgi_request.POST.get('email','').lower()
+ salt = randint(1,100000)
+ email_hash = md5(str(salt)+post_email).hexdigest()
+ #email_hash = md5(post_email).digest().encode('base64')[:-1]