Prevent users that have never subscribed to subscribe on Eboutic

This commit is contained in:
Skia
2016-12-20 23:27:54 +01:00
parent 4edd535460
commit 13785fd520
3 changed files with 34 additions and 30 deletions

View File

@ -78,6 +78,8 @@ class EbouticMain(TemplateView):
kwargs['basket'] = self.basket
kwargs['eboutic'] = Counter.objects.filter(type="EBOUTIC").first()
kwargs['categories'] = ProductType.objects.all()
if not self.request.user.was_subscribed():
kwargs['categories'] = kwargs['categories'].exclude(id=settings.SITH_PRODUCTTYPE_SUBSCRIPTION)
return kwargs
class EbouticCommand(TemplateView):