second patch on eboutic

This commit is contained in:
Thomas Girod
2022-11-16 20:41:24 +01:00
parent 96510b270d
commit 60eff1000f
6 changed files with 106 additions and 81 deletions

View File

@ -41,7 +41,9 @@ def get_eboutic_products(user: User) -> List[Product]:
.products.filter(product_type__isnull=False)
.filter(archived=False)
.filter(limit_age__lte=user.age)
.annotate(priority=F("product_type__priority"))
.annotate(category=F("product_type__name"))
.annotate(category_comment=F("product_type__comment"))
)
return [p for p in products if p.can_be_sold_to(user)]