summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Marillonnet <pmarillonnet@entrouvert.com>2017-10-18 07:49:01 (GMT)
committerPaul Marillonnet <pmarillonnet@entrouvert.com>2017-10-18 07:49:01 (GMT)
commite5b6481a15279bb8de75336e19056413f8ae102b (patch)
tree015dd16e80f92507e8cf7e35fbf247c3035a7f16
parent5726ddcf1fa875c51c9f747895ce1696c800891f (diff)
downloadpaul-synchro-e5b6481a15279bb8de75336e19056413f8ae102b.zip
paul-synchro-e5b6481a15279bb8de75336e19056413f8ae102b.tar.gz
paul-synchro-e5b6481a15279bb8de75336e19056413f8ae102b.tar.bz2
POC Campus Condorcet : correction structure conditionnelle
etablissement peut valoir une chaine unicode vide, on cherche ici a tester l'existence d'une valeur initialisee
-rw-r--r--django/sp_sso/saml/views.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/sp_sso/saml/views.py b/django/sp_sso/saml/views.py
index ff56199..5697003 100644
--- a/django/sp_sso/saml/views.py
+++ b/django/sp_sso/saml/views.py
@@ -65,7 +65,7 @@ class RegistrationFormView(FormView):
initial[attribute] = attribute_element
initial['user_nickname'] = ' %s %s' % (getattr(self.request.user, 'prenom', ''),
getattr(self.request.user, 'nom', ''))
- if getattr(self.request.user, 's_etablissement', [None])[0]:
+ if hasattr(self.request.user, 's_etablissement') and self.request.user.s_etablissement:
self.request.session['code_etablissement'] = getattr(self.request.user, 's_etablissement')
initial['s_etablissement'] = ldap_get_description_etablissements(
getattr(self.request.user, 's_etablissement')) or getattr(self.request.user,'s_etablissement')