From b3dc063c20d8641b1341d806191e5049c22e1703 Mon Sep 17 00:00:00 2001
From: Maxime Bombar
Date: Thu, 1 Nov 2018 00:49:08 +0100
Subject: [PATCH 1/2] Refactor welcome email : You're not a member if you
didn't pay for membership
---
users/templates/users/email_welcome | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/users/templates/users/email_welcome b/users/templates/users/email_welcome
index 690f69d1..27e92cc7 100644
--- a/users/templates/users/email_welcome
+++ b/users/templates/users/email_welcome
@@ -1,6 +1,8 @@
Bonjour {{nom}} !
-Vous êtes maintenant adhérent de {{asso_name}} ! Nous sommes ravis de vous accueillir dans l'association.
+Il vous suffit maintenant de payer l'adhésion pour devenir adhérent de {{asso_name}} et bénéficier des services. Pour avoir accès à Internet, il vous faudra payer la connexion.
+
+Pour ce faire, rien de plus simple. Une fois que vous aurez défini votre mot de passe, il vous suffira d'accéder à votre profil et de cliquer sur 'Payer la connexion'
Votre pseudo est : {{pseudo}}
@@ -13,7 +15,9 @@ L'équipe de {{asso_name}}.
---
-Welcome to the {{asso_name}} !
+You just need to pay membership to become a full member of {{asso_name}} and benefit from the services. To have Internet access, you will need to pay the connexion.
+
+Nothing could be simpler. Once your password is defined, you just need to visit your profile and click on 'Pay for a connexion'.
Your username is : {{pseudo}}
From baa23694365e35b67677c6756f38bfc3290516d6 Mon Sep 17 00:00:00 2001
From: Maxime Bombar
Date: Thu, 1 Nov 2018 01:07:33 +0100
Subject: [PATCH 2/2] Non member can't buy connexion : They need to pay
membership
---
cotisations/models.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/cotisations/models.py b/cotisations/models.py
index 9f294f6b..6dd63b6f 100644
--- a/cotisations/models.py
+++ b/cotisations/models.py
@@ -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')
-