diff --git a/counter/views.py b/counter/views.py index 9e6df235..4d5af292 100644 --- a/counter/views.py +++ b/counter/views.py @@ -583,7 +583,7 @@ class CounterClick(CounterTabsMixin, CanViewMixin, DetailView): - , where the string is the code of the product - X, where the integer is the quantity and str the code """ - string = parse_qs(request.body.decode())["code"][0].upper() + string = parse_qs(request.body.decode()).get("code", [""])[0].upper() if string == "FIN": return self.finish(request) elif string == "ANN":