From 52f3d4d5503b5ed9719fff3c96d4740af5025698 Mon Sep 17 00:00:00 2001 From: detraz Date: Sat, 8 Sep 2018 21:09:17 +0200 Subject: [PATCH 1/4] =?UTF-8?q?Not=20yet=20member,=20possibilit=C3=A9=20de?= =?UTF-8?q?=20trouver=20les=20users=20pas=20encore=20adh=C3=A9rents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logs/views.py | 8 ++++++++ search/forms.py | 1 + 2 files changed, 9 insertions(+) diff --git a/logs/views.py b/logs/views.py index a9fe5418..21e3c470 100644 --- a/logs/views.py +++ b/logs/views.py @@ -254,6 +254,14 @@ def stats_general(request): .count()), Club.objects.filter(state=Club.STATE_ARCHIVE).count() ], + 'not_active_users': [ + _("Not yet active users"), + User.objects.filter(state=User.STATE_NOT_YET_ACTIVE).count(), + (Adherent.objects + .filter(state=Adherent.STATE_NOT_YET_ACTIVE) + .count()), + Club.objects.filter(state=Club.STATE_NOT_YET_ACTIVE).count() + ], 'adherent_users': [ _("Contributing members"), _all_adherent.count(), diff --git a/search/forms.py b/search/forms.py index 6065e799..5c98415f 100644 --- a/search/forms.py +++ b/search/forms.py @@ -33,6 +33,7 @@ CHOICES_USER = ( ('0', _("Active")), ('1', _("Disabled")), ('2', _("Archived")), + ('3', _("Not Yet Active")), ) CHOICES_AFF = ( From 5b347f3db4f63715e731dec8c251c2c9c3dfe7f6 Mon Sep 17 00:00:00 2001 From: detraz Date: Sat, 8 Sep 2018 21:09:48 +0200 Subject: [PATCH 2/4] Fix, utilise la bonne fonction d'envoie de mails --- cotisations/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cotisations/utils.py b/cotisations/utils.py index 0211dd40..a8c2768e 100644 --- a/cotisations/utils.py +++ b/cotisations/utils.py @@ -89,7 +89,7 @@ def send_mail_invoice(invoice): 'Votre facture / Your invoice', template.render(ctx), GeneralOption.get_cached_value('email_from'), - [invoice.user.email], + [invoice.user.get_mail], attachments=[('invoice.pdf', pdf, 'application/pdf')] ) mail.send() From 9fdadaf478310dce7aa1ca2c9dbb107b7493b536 Mon Sep 17 00:00:00 2001 From: detraz Date: Sat, 8 Sep 2018 21:11:04 +0200 Subject: [PATCH 3/4] =?UTF-8?q?Le=20home=20est=20une=20methode=20+=20r?= =?UTF-8?q?=C3=A8gle=20les=20probl=C3=A8mes=20de=20la=20casse=20sur=20le?= =?UTF-8?q?=20pseudo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users/models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/users/models.py b/users/models.py index 41090ab1..f579148c 100755 --- a/users/models.py +++ b/users/models.py @@ -93,7 +93,7 @@ from preferences.models import OptionalMachine, MailMessageOption def linux_user_check(login): """ Validation du pseudo pour respecter les contraintes unix""" - UNIX_LOGIN_PATTERN = re.compile("^[a-zA-Z0-9-]*[$]?$") + UNIX_LOGIN_PATTERN = re.compile("^[a-zA-Z][a-zA-Z0-9-]*[$]?$") return UNIX_LOGIN_PATTERN.match(login) @@ -374,6 +374,10 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, si il n'est pas défini""" return self.shell or OptionalUser.get_cached_value('shell_default') + @cached_property + def home_directory(self): + return '/home/' + self.pseudo + @cached_property def get_shadow_expire(self): """Return the shadow_expire value for the user""" @@ -581,7 +585,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, user_ldap.name = self.pseudo user_ldap.sn = self.pseudo user_ldap.dialupAccess = str(self.has_access()) - user_ldap.home_directory = '/home/' + self.pseudo + user_ldap.home_directory = self.home_directory user_ldap.mail = self.get_mail user_ldap.given_name = self.surname.lower() + '_'\ + self.name.lower()[:3] From f2c132016f23ff9f3a640e50a4f8a128b7103513 Mon Sep 17 00:00:00 2001 From: detraz Date: Sat, 8 Sep 2018 21:11:42 +0200 Subject: [PATCH 4/4] =?UTF-8?q?Les=20factures=20sont=20valid=C3=A9es=20en?= =?UTF-8?q?=20post=5Fpaiement=20+=20bug=20fix=20paiement=20relation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cotisations/views.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cotisations/views.py b/cotisations/views.py index 9241f209..4cd76f93 100644 --- a/cotisations/views.py +++ b/cotisations/views.py @@ -836,7 +836,6 @@ def credit_solde(request, user, **_kwargs): else: price_ok = True if price_ok: - invoice.valid = True invoice.save() Vente.objects.create( facture=invoice, @@ -852,6 +851,6 @@ def credit_solde(request, user, **_kwargs): 'balance': user.solde, 'title': _("Refill your balance"), 'action_name': _("Pay"), - 'max_balance': p.payment_method.maximum_balance, + 'max_balance': find_payment_method(p).maximum_balance, }, 'cotisations/facture.html', request)