diff options
author | Ben Copeland <ben.copeland@linaro.org> | 2018-01-19 16:50:38 +0000 |
---|---|---|
committer | Ben Copeland <ben.copeland@linaro.org> | 2018-01-19 16:55:14 +0000 |
commit | aab5976b1aec44e25620f1ccb7dcdd6ac2061b7f (patch) | |
tree | c94ea8a2507749970ec04470bffc6dce690a177c | |
parent | 94cee4178a3c300979831b9cdccc81516780f662 (diff) |
From Django 1.11 support for passing a Context has been deprecated.
"TypeError: context must be a dict rather than RequestContext."
Use the render shortcut instead https://docs.djangoproject.com/en/1.11/topics/http/shortcuts/#render
-rw-r--r-- | django_openid_auth/views.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/django_openid_auth/views.py b/django_openid_auth/views.py index 87ecfb8..46abe91 100644 --- a/django_openid_auth/views.py +++ b/django_openid_auth/views.py @@ -43,9 +43,8 @@ from django.contrib.auth.models import Group from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseRedirect from django.http.request import QueryDict -from django.shortcuts import render_to_response +from django.shortcuts import render_to_response, render from django.template import RequestContext -from django.template.loader import render_to_string try: from django.views.decorators.csrf import csrf_exempt except ImportError: @@ -133,10 +132,7 @@ def default_render_failure(request, message, status=403, template_name='openid/failure.html', exception=None): """Render an error page to the user.""" - context = RequestContext(request).flatten() - context.update(dict(message=message, exception=exception)) - data = render_to_string(template_name, context) - return HttpResponse(data, status=status) + return render(request, template_name) def parse_openid_response(request): |