|
|
|
@ -18,12 +18,14 @@ class PromoPluginPublisher(CMSPluginBase): |
|
|
|
|
|
|
|
|
|
|
|
promos = Promo.objects.filter(page_link_id__in=history).order_by('?') |
|
|
|
promos = Promo.objects.filter(page_link_id__in=history).order_by('?') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context.update({'history': history}) |
|
|
|
|
|
|
|
|
|
|
|
if promos.exists(): |
|
|
|
if promos.exists(): |
|
|
|
promo = promos[0] |
|
|
|
promo = promos[0] |
|
|
|
promo.text = promo.text.replace('#promo', promo.page_link.get_absolute_url()) |
|
|
|
promo.text = promo.text.replace('#promo', promo.page_link.get_absolute_url()) |
|
|
|
context.update({ |
|
|
|
context.update({ |
|
|
|
'instance': promo, |
|
|
|
'instance': promo, |
|
|
|
'history': history |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
return context |
|
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|