Skip to content

Commit 2b2f374

Browse files
committed
Fix config errors
1 parent 5c59f6b commit 2b2f374

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

djangosaml2/views.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ def login(request,
147147

148148
kwargs = {}
149149
# pysaml needs a string otherwise: "cannot serialize True (type bool)"
150-
if getattr(conf, '_sp_force_authn'):
150+
if getattr(conf, '_sp_force_authn', False):
151151
kwargs['force_authn'] = "true"
152-
if getattr(conf, '_sp_allow_create', "false"):
152+
if getattr(conf, '_sp_allow_create', False):
153153
kwargs['allow_create'] = "true"
154154

155155
# is a embedded wayf needed?
@@ -165,7 +165,8 @@ def login(request,
165165
if not idps:
166166
raise IdPConfigurationMissing(('IdP configuration is missing or '
167167
'its metadata is expired.'))
168-
selected_idp = list(idps.keys())[0]
168+
if selected_idp is None:
169+
selected_idp = list(idps.keys())[0]
169170

170171
# choose a binding to try first
171172
sign_requests = getattr(conf, '_sp_authn_requests_signed', False)

0 commit comments

Comments
 (0)