From 4e525f5d798ff121ebd11505eaa154b1126ecec5 Mon Sep 17 00:00:00 2001 From: kitoy Date: Thu, 1 Sep 2022 10:32:31 +0200 Subject: [PATCH] Correction d'un bug --- tools/utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/utils.py b/tools/utils.py index 5c7e066..2419152 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -34,9 +34,13 @@ def email_disp(email): # Caractères non autorisés dans la RFC #822 invalid_char = { '(', ')', '<', '>', ',', ';', ':', '"', '[', ']', '|', 'ç', '%', '&' } + for character in invalid_char: + if character in email: + disp=False + cursor.execute("""SELECT mail FROM users WHERE mail=?""", (email,)) testmail = cursor.fetchall() - if testmail : + if testmail and disp: disp = False if disp: @@ -48,9 +52,6 @@ def email_disp(email): if email in alias: disp=False - for character in invalid_char: - if(email.find(character)>0): - disp=False else: