3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-11-22 03:13:12 +00:00

Merge branch 'master' into dev

This commit is contained in:
Yoann Pétri 2019-06-22 23:25:05 +02:00
commit 3549763658
3 changed files with 5 additions and 3 deletions

View file

@ -1,3 +1,5 @@
## v3.5.3
* Fix le profil (division par 0 lorsque toutes les transactions d'un produit avaient été annulées)
## v3.5.2 ## v3.5.2
* Fix la vue editKeg * Fix la vue editKeg
## v3.5.1 ## v3.5.1

View file

@ -42,6 +42,6 @@
<li><a href="https://www.facebook.com/coopesmetz/" class="icon fa-facebook alt"><span class="label">Facebook</span></a></li> <li><a href="https://www.facebook.com/coopesmetz/" class="icon fa-facebook alt"><span class="label">Facebook</span></a></li>
</ul> </ul>
</section> </section>
<p class="copyright">coope.rez v3.5.2 (release stable) &copy; 2018-2019 Yoann Pietri.</p> <p class="copyright">coope.rez v3.5.3 (release stable) &copy; 2018-2019 Yoann Pietri.</p>

View file

@ -138,7 +138,7 @@ def profile(request, pk):
products = [] products = []
quantities = [] quantities = []
for k in range(tot): 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]) products.append(products_pre[k])
quantities.append(quantities_pre[k]) quantities.append(quantities_pre[k])
lastConsumptions = ConsumptionHistory.objects.filter(customer=user).order_by('-date')[:10] lastConsumptions = ConsumptionHistory.objects.filter(customer=user).order_by('-date')[:10]
@ -753,4 +753,4 @@ class NonAdminUserAutocomplete(autocomplete.Select2QuerySetView):
qs = User.objects.filter(is_staff=False) qs = User.objects.filter(is_staff=False)
if self.q: if self.q:
qs = qs.filter(Q(username__icontains=self.q) | Q(first_name__icontains=self.q) | Q(last_name__icontains=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