mirror of
https://github.com/ae-utbm/sith.git
synced 2026-02-09 00:51:29 +00:00
explanation message when eboutic bank payments are disabled
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -77,6 +77,14 @@
|
||||
value="{% trans %}Pay with credit card{% endtrans %}"
|
||||
/>
|
||||
</form>
|
||||
{% else %}
|
||||
<div class="alert alert-yellow">
|
||||
{% 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 %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if basket.contains_refilling_item %}
|
||||
<p>{% trans %}AE account payment disabled because your basket contains refilling items.{% endtrans %}</p>
|
||||
|
||||
@@ -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 <thomas.girod@utbm.fr\n"
|
||||
"Language-Team: AE info <ae.info@utbm.fr>\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."
|
||||
|
||||
Reference in New Issue
Block a user