Fix rare crash in cart ID creation (PRETIXEU-78E)

This commit is contained in:
Raphael Michel
2022-09-12 12:41:17 +02:00
parent 62f7bd4fa5
commit 489ad87ad6

View File

@@ -353,7 +353,8 @@ def get_or_create_cart_id(request, create=True):
if cart_invalidated:
# This cart was created with a login but the person is now logged out.
# Destroy the cart for privacy protection.
request.session['carts'][current_id] = {}
if 'carts' in request.session:
request.session['carts'][current_id] = {}
else:
return current_id