From ee3e375dded026f61f0a9ba63e163cb377a5173d Mon Sep 17 00:00:00 2001 From: lsacienne Date: Thu, 28 Apr 2022 11:13:07 +0200 Subject: [PATCH] Post request management --- counter/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/counter/views.py b/counter/views.py index a176ba6a..ff2ed6b1 100644 --- a/counter/views.py +++ b/counter/views.py @@ -725,7 +725,7 @@ class CounterClick(CounterTabsMixin, CanViewMixin, DetailView): def refill(self, request): """Refill the customer's account""" - if self.get_object().type == "BAR": + if self.get_object().type == "BAR" and self.object.can_refill(): form = RefillForm(request.POST) if form.is_valid(): form.instance.counter = self.object