Skip to content

Commit 09b543c

Browse files
committed
Adapt renders from Django demo for Django 1.11 version
1 parent db1e9a6 commit 09b543c

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

demo-django/demo/views.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
from django.urls import reverse
33
from django.http import (HttpResponse, HttpResponseRedirect,
44
HttpResponseServerError)
5-
from django.shortcuts import render_to_response
6-
from django.template import RequestContext
5+
from django.shortcuts import render
76

87
from onelogin.saml2.auth import OneLogin_Saml2_Auth
98
from onelogin.saml2.settings import OneLogin_Saml2_Settings
@@ -78,13 +77,8 @@ def index(request):
7877
if len(request.session['samlUserdata']) > 0:
7978
attributes = request.session['samlUserdata'].items()
8079

81-
context = RequestContext(request, {'errors': errors,
82-
'not_auth_warn': not_auth_warn,
83-
'success_slo': success_slo,
84-
'attributes': attributes,
85-
'paint_logout': paint_logout}).flatten()
86-
return render_to_response('index.html',
87-
context=context)
80+
return render(request, 'index.html', {'errors': errors, 'not_auth_warn': not_auth_warn, 'success_slo': success_slo,
81+
'attributes': attributes, 'paint_logout': paint_logout})
8882

8983

9084
def attrs(request):
@@ -95,10 +89,9 @@ def attrs(request):
9589
paint_logout = True
9690
if len(request.session['samlUserdata']) > 0:
9791
attributes = request.session['samlUserdata'].items()
98-
99-
return render_to_response('attrs.html',
100-
context=RequestContext(request, {'paint_logout': paint_logout,
101-
'attributes': attributes}).flatten())
92+
return render(request, 'attrs.html',
93+
{'paint_logout': paint_logout,
94+
'attributes': attributes})
10295

10396

10497
def metadata(request):

0 commit comments

Comments
 (0)