Skip to content

Commit 257ba9a

Browse files
authored
Merge pull request #175 from OskarPersson/fix-conf-errors
Fix configuration and Travis errors
2 parents 5c59f6b + 00ddfd6 commit 257ba9a

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

.travis.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
dist: bionic
12
language: python
23

34
sudo: false
@@ -6,30 +7,20 @@ matrix:
67
include:
78
- python: 2.7
89
env: TOX_ENV=py27-django18
9-
- python: 3.4
10-
env: TOX_ENV=py34-django18
1110
- python: 2.7
1211
env: TOX_ENV=py27-django19
13-
- python: 3.4
14-
env: TOX_ENV=py34-django19
1512
- python: 3.5
1613
env: TOX_ENV=py35-django19
1714
- python: 2.7
1815
env: TOX_ENV=py27-django110
19-
- python: 3.4
20-
env: TOX_ENV=py34-django110
2116
- python: 3.5
2217
env: TOX_ENV=py35-django110
2318
- python: 2.7
2419
env: TOX_ENV=py27-django111
25-
- python: 3.4
26-
env: TOX_ENV=py34-django111
2720
- python: 3.5
2821
env: TOX_ENV=py35-django111
2922
- python: 3.6
3023
env: TOX_ENV=py36-django111
31-
- python: 3.4
32-
env: TOX_ENV=py34-django20
3324
- python: 3.5
3425
env: TOX_ENV=py35-django20
3526
- python: 3.6

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)

tox.ini

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[tox]
22
envlist =
3-
py{27,34,35}-django18
4-
py{27,34,35}-django19
5-
py{27,34,35}-django110
6-
py{27,34,35,36}-django111
7-
py{34,35,36,37}-django20
3+
py{27,35}-django18
4+
py{27,35}-django19
5+
py{27,35}-django110
6+
py{27,35,36}-django111
7+
py{35,36,37}-django20
88
py{35,36,37}-django21
99
py{35,36,37}-django22
1010
py{36,37}-django30

0 commit comments

Comments
 (0)