Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pretix public registrations
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KIF
Pretix public registrations
Commits
9b1329dc
Commit
9b1329dc
authored
2 years ago
by
Felix Schäfer
Browse files
Options
Downloads
Patches
Plain Diff
Use more compact cache method
parent
5816fe3d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pretix_public_registrations/signals.py
+4
-5
4 additions, 5 deletions
pretix_public_registrations/signals.py
with
4 additions
and
5 deletions
pretix_public_registrations/signals.py
+
4
−
5
View file @
9b1329dc
...
...
@@ -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
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment