mirror of
https://github.com/ae-utbm/sith.git
synced 2026-02-08 16:41:29 +00:00
explanation message when eboutic bank payments are disabled
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user