POC Campus Condorcet : l'attribut host_type mis en session dans tous les cas

This commit is contained in:
Paul Marillonnet 2017-10-12 10:04:48 +02:00
parent 67ce681718
commit dc46c9474c
1 changed files with 2 additions and 1 deletions

View File

@ -37,11 +37,12 @@ def user_in_ldap(function):
appear in a `ou=people...` sub-entry in the Campus LDAP.
"""
def wrapped(request, *args, **kwargs):
if not 'mellon_session' in request.session:
if 'host_type' not in request.session:
if request.GET.get('host_type') == 'member':
request.session['host_type'] = 'member'
else:
request.session['host_type'] = 'affiliate'
if not 'mellon_session' in request.session:
return redirect(reverse('auth_login') + "?next="+request.path)
user_data = saml_collect_data(request)
if not ldap_contains_user(user_data):