mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Require a session to be present at all times, not just in pretix.presale views
This commit is contained in:
@@ -67,6 +67,14 @@ class SessionMiddleware(BaseSessionMiddleware):
|
||||
a custom domain.
|
||||
"""
|
||||
|
||||
def process_request(self, request):
|
||||
super().process_request(request)
|
||||
|
||||
if not request.session.session_key:
|
||||
# We need to create session even if we do not yet store something there, because we need the session
|
||||
# key for e.g. saving the user's cart
|
||||
request.session.create()
|
||||
|
||||
def process_response(self, request, response):
|
||||
try:
|
||||
accessed = request.session.accessed
|
||||
|
||||
Reference in New Issue
Block a user