Skip to content

Commit fe9b421

Browse files
authored
Cast major/minor django VERSION number into float before comparing (#269)
1 parent 1c88821 commit fe9b421

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

djangosaml2/middleware.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
from django.utils.http import http_date
1010

1111

12-
SAMESITE_NONE = None if (VERSION[0] < 3.1) else 'None'
12+
django_version = float('{}.{}'.format(*VERSION[:2]))
13+
SAMESITE_NONE = None if django_version < 3.1 else 'None'
1314

1415

1516
class SamlSessionMiddleware(SessionMiddleware):

0 commit comments

Comments
 (0)