aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-django-oscar/0011-Fix-deprecated-use-of-RequestContext-in-render_promo.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/py-django-oscar/0011-Fix-deprecated-use-of-RequestContext-in-render_promo.patch')
-rw-r--r--main/py-django-oscar/0011-Fix-deprecated-use-of-RequestContext-in-render_promo.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/main/py-django-oscar/0011-Fix-deprecated-use-of-RequestContext-in-render_promo.patch b/main/py-django-oscar/0011-Fix-deprecated-use-of-RequestContext-in-render_promo.patch
new file mode 100644
index 0000000000..f6ecd6bebb
--- /dev/null
+++ b/main/py-django-oscar/0011-Fix-deprecated-use-of-RequestContext-in-render_promo.patch
@@ -0,0 +1,41 @@
+From 1709f673d74d1cd93c741111bd7f215c05a3f038 Mon Sep 17 00:00:00 2001
+From: Samir Shah <samir@regulusweb.com>
+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
+