From 347fea9ff3d721b86349d443313661de5d88ae0a Mon Sep 17 00:00:00 2001 From: Emmanuel Cazenave Date: Thu, 2 Aug 2018 19:02:41 +0200 Subject: [PATCH] remove use of context_instance (#25531) --- src/authentic2_auth_fedict/auth_frontends.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/authentic2_auth_fedict/auth_frontends.py b/src/authentic2_auth_fedict/auth_frontends.py index 25f9c38..fd1ec0c 100644 --- a/src/authentic2_auth_fedict/auth_frontends.py +++ b/src/authentic2_auth_fedict/auth_frontends.py @@ -15,7 +15,6 @@ # along with this program. If not, see . from django.template.loader import render_to_string -from django.template import RequestContext from django.shortcuts import render from django.utils.translation import ugettext_lazy as _ @@ -36,20 +35,21 @@ class FedictFrontend(object): return _('Belgian eID') def login(self, request, *args, **kwargs): - context_instance = kwargs.pop('context_instance', None) or RequestContext(request) + context = kwargs.get('context', {}) submit_name = 'login-%s' % self.id if request.method == 'POST' and submit_name in request.POST: return redirect_to_login(request, login_url='fedict-login') + context['submit_name'] = submit_name return render(request, 'authentic2_auth_fedict/login.html', {'submit_name': submit_name}, - context_instance=context_instance) + context) def profile(self, request, *args, **kwargs): - context_instance = kwargs.pop('context_instance', None) or RequestContext(request) + context = kwargs.get('context', {}) user_saml_identifiers = request.user.saml_identifiers.all() if not user_saml_identifiers: return '' for user_saml_identifier in user_saml_identifiers: user_saml_identifier.idp = get_idp(user_saml_identifier.issuer) - return render_to_string('authentic2_auth_fedict/profile.html', - {'user_saml_identifiers': user_saml_identifiers}, - context_instance=context_instance) + context['user_saml_identifiers'] = user_saml_identifiers + return render_to_string('authentic2_auth_fedict/profile.html', context, + request=request) -- 2.18.0