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