|
|
@@ -1,5 +1,7 @@
|
|
1
|
1
|
from django.template import Library, Node, Variable, Context
|
|
2
|
2
|
from django.template.loader import select_template
|
|
|
3
|
+from django.template import RequestContext
|
|
|
4
|
+
|
|
3
|
5
|
|
|
4
|
6
|
register = Library()
|
|
5
|
7
|
|
|
|
@@ -11,7 +13,9 @@ class PromotionNode(Node):
|
|
11
|
13
|
def render(self, context):
|
|
12
|
14
|
promotion = self.promotion_var.resolve(context)
|
|
13
|
15
|
template = select_template([promotion.template_name(), 'promotions/default.html'])
|
|
14
|
|
- args = dict(promotion=promotion, **promotion.template_context(request=context['request']))
|
|
|
16
|
+ args = dict(promotion=promotion,
|
|
|
17
|
+ **promotion.template_context(request=context['request'])
|
|
|
18
|
+ context_instance=RequestContext(context['request']))
|
|
15
|
19
|
return template.render(Context(args))
|
|
16
|
20
|
|
|
17
|
21
|
def get_promotion_html(parser, token):
|