diff --git a/counter/models.py b/counter/models.py index 996f22e6..6ceb9ea8 100644 --- a/counter/models.py +++ b/counter/models.py @@ -447,8 +447,7 @@ class Product(models.Model): buying_groups = list(self.buying_groups.all()) if not buying_groups: return True - res = any(user.is_in_group(pk=group.id) for group in buying_groups) - return res + return any(user.is_in_group(pk=group.id) for group in buying_groups) @property def profit(self): diff --git a/eboutic/models.py b/eboutic/models.py index 5a37f70f..e35b1ddf 100644 --- a/eboutic/models.py +++ b/eboutic/models.py @@ -43,12 +43,13 @@ def get_eboutic_products(user: User) -> list[Product]: products = ( get_eboutic() .products.filter(product_type__isnull=False) - .filter(archived=False) - .filter(limit_age__lte=user.age) - .annotate(order=F("product_type__order")) - .annotate(category=F("product_type__name")) - .annotate(category_comment=F("product_type__comment")) - .annotate(price=F("selling_price")) # <-- selected price for basket validation + .filter(archived=False, limit_age__lte=user.age) + .annotate( + order=F("product_type__order"), + category=F("product_type__name"), + category_comment=F("product_type__comment"), + price=F("selling_price"), # <-- selected price for basket validation + ) .prefetch_related("buying_groups") # <-- used in `Product.can_be_sold_to` ) return [p for p in products if p.can_be_sold_to(user)] diff --git a/eboutic/templates/eboutic/eboutic_checkout.jinja b/eboutic/templates/eboutic/eboutic_checkout.jinja index 745d1644..35270449 100644 --- a/eboutic/templates/eboutic/eboutic_checkout.jinja +++ b/eboutic/templates/eboutic/eboutic_checkout.jinja @@ -77,6 +77,14 @@ value="{% trans %}Pay with credit card{% endtrans %}" /> + {% else %} +
{% trans %}AE account payment disabled because your basket contains refilling items.{% endtrans %}
diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index 28b0bb9e..6d7d78b7 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-03 10:03+0100\n" +"POT-Creation-Date: 2026-02-08 16:14+0100\n" "PO-Revision-Date: 2016-07-18\n" "Last-Translator: Maréchal