Changes for Django 2.0 support

This commit is contained in:
Valentin Samir
2018-04-29 20:10:01 +02:00
parent fcafc77b98
commit 290701e07f
21 changed files with 499 additions and 738 deletions

View File

@ -46,7 +46,6 @@ MIDDLEWARE = [
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.locale.LocaleMiddleware',

View File

@ -263,7 +263,7 @@ class DummyCAS(BaseHTTPServer.BaseHTTPRequestHandler):
if self.test_params():
template = loader.get_template('cas_server/serviceValidate.xml')
context = Context({
'username': self.server.username,
'username': self.server.username.decode('utf-8'),
'attributes': self.server.attributes,
'auth_date': timezone.now().replace(microsecond=0).isoformat(),
'is_new_login': 'true',
@ -301,7 +301,7 @@ class DummyCAS(BaseHTTPServer.BaseHTTPRequestHandler):
'expireInstant': (timezone.now() + timedelta(seconds=60)).isoformat(),
'Recipient': self.server.service,
'ResponseID': utils.gen_saml_id(),
'username': self.server.username,
'username': self.server.username.decode('utf-8'),
'attributes': self.server.attributes,
'auth_date': timezone.now().replace(microsecond=0).isoformat(),
'is_new_login': 'true',