|
|
|
@ -141,7 +141,7 @@ def profile(request, pk): |
|
|
|
products = [] |
|
|
|
quantities = [] |
|
|
|
for k in range(tot): |
|
|
|
if quantities_pre[k]/totQ >= 0.01: |
|
|
|
if totQ > 0 and quantities_pre[k]/totQ >= 0.01: |
|
|
|
products.append(products_pre[k]) |
|
|
|
quantities.append(quantities_pre[k]) |
|
|
|
lastConsumptions = ConsumptionHistory.objects.filter(customer=user).order_by('-date')[:10] |
|
|
|
@ -756,4 +756,4 @@ class NonAdminUserAutocomplete(autocomplete.Select2QuerySetView): |
|
|
|
qs = User.objects.filter(is_staff=False) |
|
|
|
if self.q: |
|
|
|
qs = qs.filter(Q(username__icontains=self.q) | Q(first_name__icontains=self.q) | Q(last_name__icontains=self.q)) |
|
|
|
return qs |
|
|
|
return qs |
|
|
|
|