From 2571cc955e42aa3874c2b864ea6e0a232760ad83 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Mon, 22 May 2023 18:23:50 +0200 Subject: [PATCH] =?UTF-8?q?feat(kfet):=20D=C3=A9sactive=20l'envoi=20des=20?= =?UTF-8?q?mails=20pour=20les=20comptes=20gel=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On utilise la fonctionnalité `is_frozen` pour marquer les comptes qui n'ont plus d'adresse valide, et on répare le formulaire de màj de compte. --- kfet/management/commands/sendrappelsnegatifs.py | 3 ++- kfet/views.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kfet/management/commands/sendrappelsnegatifs.py b/kfet/management/commands/sendrappelsnegatifs.py index 4e2f67c3..29776284 100644 --- a/kfet/management/commands/sendrappelsnegatifs.py +++ b/kfet/management/commands/sendrappelsnegatifs.py @@ -26,8 +26,9 @@ class Command(BaseCommand): # On n'envoie des mails qu'aux comptes qui ont un négatif vraiment actif # et dont la balance est négative + # On ignore les comptes gelés qui signinfient une adresse mail plus valide account_negatives = AccountNegative.objects.filter( - account__balance__lt=0 + account__balance__lt=0, account__is_frozen=False ).exclude(end__lte=now) accounts_first_mail = account_negatives.filter( diff --git a/kfet/views.py b/kfet/views.py index 4ef2692e..a189d94a 100644 --- a/kfet/views.py +++ b/kfet/views.py @@ -361,7 +361,7 @@ def account_update(request, trigramme): user_info_form = UserInfoForm(instance=account.user) account_form = AccountForm(instance=account) group_form = UserGroupForm(instance=account.user) - frozen_form = AccountFrozenForm(request.POST, instance=account) + frozen_form = AccountFrozenForm(instance=account) pwd_form = AccountPwdForm() if request.method == "POST":