@register.simple_tag
def get_advertisement_html_mail():
 advertisement = Advertisement.objects.get_advertisement(Advertisement.PLACEMENT_MAIL_HTML)
 if (advertisement is None):
  return u''
 return mark_safe(advertisement.text)

@ register . simple_tag def get_advertisement_html_mail ( ) : advertisement = Advertisement . objects . get_advertisement ( Advertisement . PLACEMENT_MAIL_HTML ) if ( advertisement is None ) : return u'' return mark_safe ( advertisement . text )
returns advertisement text .