Post request management

This commit is contained in:
lsacienne 2022-04-28 11:13:07 +02:00
parent bbf362691b
commit ee3e375dde
No known key found for this signature in database
GPG Key ID: 5B1939A93F7A6F48

View File

@ -725,7 +725,7 @@ class CounterClick(CounterTabsMixin, CanViewMixin, DetailView):
def refill(self, request): def refill(self, request):
"""Refill the customer's account""" """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) form = RefillForm(request.POST)
if form.is_valid(): if form.is_valid():
form.instance.counter = self.object form.instance.counter = self.object