Make all orders "guest orders"

This commit is contained in:
Raphael Michel
2015-10-04 15:05:05 +02:00
parent c47008cc18
commit 93d027cec6
40 changed files with 296 additions and 1264 deletions

View File

@@ -13,17 +13,6 @@ class EventMiddleware:
if url_namespace != 'presale':
return
if 'order_secrets' not in request.session:
request.session['order_secrets'] = []
if 'order_secret' in request.GET and request.GET.get('order_secret') not in request.session['order_secrets']:
# We can't use append here, because this would not trigger __setitem__
# on the session store and would not be saved
request.session['order_secrets'] = request.session['order_secrets'] + [request.GET.get('order_secret')]
# Removal of the secret from the URL has been disabled so people can bookmark it
# g = request.GET.copy()
# del g['order_secret']
# return redirect(request.path + '?' + g.urlencode())
if 'event.' in url_name and 'event' in url.kwargs:
try:
request.event = Event.objects.current.filter(
@@ -32,3 +21,8 @@ class EventMiddleware:
).select_related('organizer')[0]
except IndexError:
raise Http404(_('The selected event was not found.'))
if '_' not in request.session:
# 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['_'] = '_'