From 1709f673d74d1cd93c741111bd7f215c05a3f038 Mon Sep 17 00:00:00 2001 From: Samir Shah Date: Sat, 18 Feb 2017 07:26:16 +0300 Subject: [PATCH 11/11] Fix deprecated use of RequestContext in render_promotion tag. --- src/oscar/templatetags/promotion_tags.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/oscar/templatetags/promotion_tags.py b/src/oscar/templatetags/promotion_tags.py index 471d508..a067db2 100644 --- a/src/oscar/templatetags/promotion_tags.py +++ b/src/oscar/templatetags/promotion_tags.py @@ -1,4 +1,4 @@ -from django.template import Library, RequestContext +from django.template import Library from django.template.loader import select_template register = Library() @@ -8,12 +8,12 @@ register = Library() def render_promotion(context, promotion): template = select_template([ promotion.template_name(), 'promotions/default.html']) + request = context['request'] - args = { - 'request': context['request'], + ctx = { + 'request': request, 'promotion': promotion } - args.update(**promotion.template_context(request=context['request'])) + ctx.update(**promotion.template_context(request=request)) - ctx = RequestContext(context['request'], args) - return template.render(ctx) + return template.render(ctx, request) -- 2.9.4