From dfd465c7f920f76aea1e232a6aa0a31c1dc68272 Mon Sep 17 00:00:00 2001 From: klmp200 Date: Tue, 28 Mar 2017 00:48:08 +0200 Subject: [PATCH] Fix bug where customer can't buy an item when they have the just amount --- counter/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/counter/views.py b/counter/views.py index 4de20334..ab06c864 100644 --- a/counter/views.py +++ b/counter/views.py @@ -276,7 +276,7 @@ class CounterClick(CounterTabsMixin, CanViewMixin, DetailView): total_qty_mod_6 = self.get_total_quantity_for_pid(request, pid) % 6 bq = int((total_qty_mod_6 + q) / 6) # Integer division q -= bq - if self.customer.amount < (total + q*float(price)): # Check for enough money + if self.customer.amount < (total + round(q*float(price),2)): # Check for enough money request.session['not_enough'] = True return False if product.limit_age >= 18 and not self.customer.user.date_of_birth: