fefa4ka 10 years ago
parent 1377862cff
commit cdac188e0f
  1. 8
      promo/cms_plugins.py

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

Loading…
Cancel
Save