Skip to content
Snippets Groups Projects
Commit 9b1329dc authored by Felix Schäfer's avatar Felix Schäfer :construction_worker:
Browse files

Use more compact cache method

parent 5816fe3d
No related branches found
No related tags found
No related merge requests found
......@@ -26,11 +26,10 @@ def add_public_registrations_html_head(sender, request=None, **kwargs):
url = resolve(request.path_info)
if "event.index" not in url.url_name:
return ""
cached = sender.cache.get("public_registrations_html_head")
if cached is None:
cached = get_template("pretix_public_registrations/head.html").render()
sender.cache.set("public_registrations_html_head", cached)
return cached
return sender.cache.get_or_set(
"public_registrations_html_head",
get_template("pretix_public_registrations/head.html").render(),
)
@receiver(question_form_fields, dispatch_uid="public_registration_question")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment