From dcc10ea8c6a837e638e7a427f400def291ffa2dd Mon Sep 17 00:00:00 2001 From: "Adrien Bourmault (neox)" Date: Sat, 4 Nov 2023 15:53:16 +0100 Subject: [PATCH] =?UTF-8?q?cotisation=20:=20v=C3=A9rification=20du=20courr?= =?UTF-8?q?iel=20(corrige=20#13)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controle_cotisation/main.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/controle_cotisation/main.py b/controle_cotisation/main.py index aaac890..c760faa 100755 --- a/controle_cotisation/main.py +++ b/controle_cotisation/main.py @@ -184,14 +184,18 @@ def check_email_created(member): # Get member infos name, numero, email = get_member_infos(member) - request = { 'not[labels]' : "Résolu", - 'state' : "opened" } + if numero < 15: + return True + + request = { + 'state' : "opened", + 'q' : "Création d'un compte courriel membre n°{}".format(numero) + } answer = git_mail_ticket_read(request) - for ticket in answer: - if "n°{}.".format(numero) in ticket['title']: - return False - return True + if len(anwer) >= 1: + return True + return False def notify_expired(member): BUF.append("* {}".format(member)) @@ -225,7 +229,8 @@ def notify_unpaid(member): return True def renotify_unpaid(member): - + if not check_email_created(member): + return False # Get member infos name, numero, email = get_member_infos(member) amount = "{},{}".format(str(gestion_get_amount(member))[:-2], @@ -320,7 +325,8 @@ def check_expired_unpaid(): os.remove(WORKDIR+"/transition/"+record) def validate(member): - + if not check_email_created(member): + return False # Get infos request = "SELECT *, l.reference true_reference " +\ "FROM services_users su " +\