cotisation : vérification du courriel (corrige #13)

This commit is contained in:
Adrien Bourmault 2023-11-04 15:53:16 +01:00
parent d120300cd1
commit dcc10ea8c6
Signed by: neox
GPG Key ID: 2974E1D5F25DFCC8
1 changed files with 14 additions and 8 deletions

View File

@ -184,14 +184,18 @@ def check_email_created(member):
# Get member infos # Get member infos
name, numero, email = get_member_infos(member) name, numero, email = get_member_infos(member)
request = { 'not[labels]' : "Résolu", if numero < 15:
'state' : "opened" } return True
request = {
'state' : "opened",
'q' : "Création d'un compte courriel membre n°{}".format(numero)
}
answer = git_mail_ticket_read(request) answer = git_mail_ticket_read(request)
for ticket in answer: if len(anwer) >= 1:
if "{}.".format(numero) in ticket['title']: return True
return False return False
return True
def notify_expired(member): def notify_expired(member):
BUF.append("* {}".format(member)) BUF.append("* {}".format(member))
@ -225,7 +229,8 @@ def notify_unpaid(member):
return True return True
def renotify_unpaid(member): def renotify_unpaid(member):
if not check_email_created(member):
return False
# Get member infos # Get member infos
name, numero, email = get_member_infos(member) name, numero, email = get_member_infos(member)
amount = "{},{}".format(str(gestion_get_amount(member))[:-2], amount = "{},{}".format(str(gestion_get_amount(member))[:-2],
@ -320,7 +325,8 @@ def check_expired_unpaid():
os.remove(WORKDIR+"/transition/"+record) os.remove(WORKDIR+"/transition/"+record)
def validate(member): def validate(member):
if not check_email_created(member):
return False
# Get infos # Get infos
request = "SELECT *, l.reference true_reference " +\ request = "SELECT *, l.reference true_reference " +\
"FROM services_users su " +\ "FROM services_users su " +\