summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Marillonnet <pmarillonnet@entrouvert.com>2017-10-12 08:04:48 (GMT)
committerPaul Marillonnet <pmarillonnet@entrouvert.com>2017-10-12 08:04:48 (GMT)
commitdc46c9474cfd91377f5b27c5ce5eb23ce29cbd9b (patch)
tree3e1373a0143716750006115b69b6940c1b9be640
parent67ce681718dec43cc003606919268a62372a8d62 (diff)
downloadpaul-synchro-dc46c9474cfd91377f5b27c5ce5eb23ce29cbd9b.zip
paul-synchro-dc46c9474cfd91377f5b27c5ce5eb23ce29cbd9b.tar.gz
paul-synchro-dc46c9474cfd91377f5b27c5ce5eb23ce29cbd9b.tar.bz2
POC Campus Condorcet : l'attribut host_type mis en session dans tous les cas
-rw-r--r--django/sp_sso/saml/decorators.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/sp_sso/saml/decorators.py b/django/sp_sso/saml/decorators.py
index 6baaed4..ea39df3 100644
--- a/django/sp_sso/saml/decorators.py
+++ b/django/sp_sso/saml/decorators.py
@@ -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):