Force widget data to be a dictionary

This commit is contained in:
Raphael Michel
2019-03-22 12:16:20 +01:00
parent 8e2ef604f7
commit c4b18a4c81

View File

@@ -369,6 +369,8 @@ class CartAdd(EventViewMixin, CartActionMixin, AsyncAction, View):
if "widget_data" in request.POST:
try:
widget_data = json.loads(request.POST.get("widget_data", "{}"))
if not isinstance(widget_data, dict):
widget_data = {}
except ValueError:
widget_data = {}
else: