Source

django_cookie_law_nl / cookie_law / templatetags / cookie_bar.py

Full commit
from django import template
from cookie_law.models import CookieBar

register = template.Library()

@register.inclusion_tag('cookie_law/_base_include.html')
def show_cookie_bar():
    try:
        bar = CookieBar.objects.get(use_this=True)
    except CookieBar.DoesNotExist:
        raise NotImplementedError('You must set a cookie bar to be shown in the admin.')

    return {'bar': bar}