forked from CGM_Public/pretix_original
Add a request argument to the html_head signals
This commit is contained in:
@@ -12,7 +12,8 @@ HTML head injection
|
|||||||
|
|
||||||
These two signals allow you to put code inside the HTML ``<head>`` tag
|
These two signals allow you to put code inside the HTML ``<head>`` tag
|
||||||
of every page. One signal is for the frontend, one for the backend. You
|
of every page. One signal is for the frontend, one for the backend. You
|
||||||
won't get any arguments and can return plain HTML.
|
will get the request as a keyword argument ``request`` and can return plain
|
||||||
|
HTML.
|
||||||
|
|
||||||
* ``pretix.presale.signals.html_head``
|
* ``pretix.presale.signals.html_head``
|
||||||
* ``pretix.control.signals.html_head``
|
* ``pretix.control.signals.html_head``
|
||||||
@@ -16,7 +16,7 @@ def contextprocessor(request):
|
|||||||
}
|
}
|
||||||
_html_head = []
|
_html_head = []
|
||||||
if hasattr(request, 'event'):
|
if hasattr(request, 'event'):
|
||||||
for receiver, response in html_head.send(request.event):
|
for receiver, response in html_head.send(request.event, request=request):
|
||||||
_html_head.append(response)
|
_html_head.append(response)
|
||||||
ctx['html_head'] = "".join(_html_head)
|
ctx['html_head'] = "".join(_html_head)
|
||||||
|
|
||||||
|
|||||||
@@ -13,5 +13,5 @@ restriction_formset = EventPluginSignal(
|
|||||||
This signal is sent out to include code into the HTML <head> tag
|
This signal is sent out to include code into the HTML <head> tag
|
||||||
"""
|
"""
|
||||||
html_head = EventPluginSignal(
|
html_head = EventPluginSignal(
|
||||||
providing_args=[]
|
providing_args=["request"]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ def contextprocessor(request):
|
|||||||
}
|
}
|
||||||
_html_head = []
|
_html_head = []
|
||||||
if hasattr(request, 'event'):
|
if hasattr(request, 'event'):
|
||||||
for receiver, response in html_head.send(request.event):
|
for receiver, response in html_head.send(request.event, request=request):
|
||||||
_html_head.append(response)
|
_html_head.append(response)
|
||||||
ctx['html_head'] = "".join(_html_head)
|
ctx['html_head'] = "".join(_html_head)
|
||||||
|
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ from pretix.base.signals import EventPluginSignal
|
|||||||
This signal is sent out to include code into the HTML <head> tag
|
This signal is sent out to include code into the HTML <head> tag
|
||||||
"""
|
"""
|
||||||
html_head = EventPluginSignal(
|
html_head = EventPluginSignal(
|
||||||
providing_args=[]
|
providing_args=["request"]
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user