Commit baa23694 authored by Maxime Bombar's avatar Maxime Bombar Committed by detraz

Non member can't buy connexion : They need to pay membership

parent b3dc063c
......@@ -624,6 +624,10 @@ class Article(RevMixin, AclMixin, models.Model):
objects_pool = cls.objects.filter(
Q(type_user='All') | Q(type_user='Adherent')
)
if not target_user.is_adherent():
objects_pool = objects_pool.filter(
Q(type_cotisation='All') | Q(type_cotisation='Adhesion')
)
if user.has_perm('cotisations.buy_every_article'):
return objects_pool
return objects_pool.filter(available_for_everyone=True)
......@@ -874,4 +878,3 @@ def cotisation_post_delete(**_kwargs):
"""
regen('mac_ip_list')
regen('mailing')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment