X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Fregistrationview.py;h=b996e95a5c73b4a5ee24f2ec110de4896347c7cc;hb=507aaa799377f1f5838bd8b8de19c4aef90e0ddc;hp=afaa67c2c9a6fabf0326004bc8057f6e110e2931;hpb=12e7d0096c803ae8d72687c049b07b3676e0b1d2;p=myslice.git diff --git a/portal/registrationview.py b/portal/registrationview.py index afaa67c2..b996e95a 100644 --- a/portal/registrationview.py +++ b/portal/registrationview.py @@ -37,7 +37,7 @@ class RegistrationView (FreeAccessView, ThemeView): """ """ errors = [] - + authority_hrn = None authorities_query = Query.get('authority').select('name', 'authority_hrn') authorities = execute_admin_query(wsgi_request, authorities_query) if authorities is not None: @@ -57,13 +57,14 @@ class RegistrationView (FreeAccessView, ThemeView): current_site = Site.objects.get_current() current_site = current_site.domain - 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'] + # Handle the case when the template uses only hrn and not name + if authority_hrn is None: + authority_hrn = wsgi_request.POST.get('org_name', '') + post_email = wsgi_request.POST.get('email','').lower() salt = randint(1,100000) email_hash = md5(str(salt)+post_email).hexdigest()