From df2e65a99149f072644d8199a7063b4ef166772f Mon Sep 17 00:00:00 2001 From: imperosol Date: Sun, 8 Feb 2026 16:19:57 +0100 Subject: [PATCH 1/2] explanation message when eboutic bank payments are disabled --- counter/models.py | 3 +-- eboutic/models.py | 13 +++++++------ eboutic/templates/eboutic/eboutic_checkout.jinja | 8 ++++++++ locale/fr/LC_MESSAGES/django.po | 12 +++++++++++- 4 files changed, 27 insertions(+), 9 deletions(-) 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 trimmed %} + Credit card payments are currently disabled on the eboutic. + You may still refill your account in one of the AE counters. + Please excuse for the disagreement. + {% endtrans %} +
{% endif %} {% if basket.contains_refilling_item %}

{% 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 \n" @@ -3944,6 +3944,16 @@ msgstr "Solde restant : " msgid "Pay with credit card" msgstr "Payer avec une carte bancaire" +#: eboutic/templates/eboutic/eboutic_checkout.jinja +msgid "" +"Credit card payments are currently disabled on the eboutic. You may still " +"refill your account in one of the AE counters. Please excuse for the " +"disagreement." +msgstr "" +"Les paiements par carte bancaire sont actuellement désactivés sur l'eboutic. " +"Vous pouvez cependant toujours recharger votre compte dans un des lieux de vie de l'AE. " +"Veuillez nous excuser pour le désagrément." + #: eboutic/templates/eboutic/eboutic_checkout.jinja msgid "" "AE account payment disabled because your basket contains refilling items." From b6f77dea97cfbe3f170116943e0a2d1fe18877cc Mon Sep 17 00:00:00 2001 From: imperosol Date: Mon, 9 Feb 2026 15:24:52 +0100 Subject: [PATCH 2/2] apply review suggestion --- eboutic/templates/eboutic/eboutic_checkout.jinja | 2 +- locale/fr/LC_MESSAGES/django.po | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eboutic/templates/eboutic/eboutic_checkout.jinja b/eboutic/templates/eboutic/eboutic_checkout.jinja index 35270449..5bf89f98 100644 --- a/eboutic/templates/eboutic/eboutic_checkout.jinja +++ b/eboutic/templates/eboutic/eboutic_checkout.jinja @@ -82,7 +82,7 @@ {% trans trimmed %} Credit card payments are currently disabled on the eboutic. You may still refill your account in one of the AE counters. - Please excuse for the disagreement. + Please excuse us for the inconvenience. {% endtrans %} {% endif %} diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index 6d7d78b7..50cff3ec 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -3947,8 +3947,8 @@ msgstr "Payer avec une carte bancaire" #: eboutic/templates/eboutic/eboutic_checkout.jinja msgid "" "Credit card payments are currently disabled on the eboutic. You may still " -"refill your account in one of the AE counters. Please excuse for the " -"disagreement." +"refill your account in one of the AE counters. Please excuse us for the " +"inconvenience." msgstr "" "Les paiements par carte bancaire sont actuellement désactivés sur l'eboutic. " "Vous pouvez cependant toujours recharger votre compte dans un des lieux de vie de l'AE. "