mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
28 lines
650 B
Python
28 lines
650 B
Python
from django.conf import settings
|
|
from django.core.urlresolvers import Resolver404, resolve
|
|
|
|
from .signals import html_head
|
|
|
|
|
|
def contextprocessor(request):
|
|
"""
|
|
Adds data to all template contexts
|
|
"""
|
|
try:
|
|
url = resolve(request.path_info)
|
|
except Resolver404:
|
|
return {}
|
|
if url.namespace != 'presale':
|
|
return {}
|
|
|
|
ctx = {
|
|
}
|
|
_html_head = []
|
|
if hasattr(request, 'event'):
|
|
for receiver, response in html_head.send(request.event, request=request):
|
|
_html_head.append(response)
|
|
ctx['html_head'] = "".join(_html_head)
|
|
ctx['site_url'] = settings.SITE_URL
|
|
|
|
return ctx
|