Integrate htmx and dropzone for file Section
This commit is contained in:
@@ -39,6 +39,28 @@ def append_to_log(log_line, user):
|
||||
log.close()
|
||||
|
||||
|
||||
|
||||
def valid_email(mail):
|
||||
valid=True
|
||||
# Caractères non autorisés dans la RFC #822
|
||||
invalid_char = { '(', ')', '<', '>', ',', ';', ':', '"', '[', ']', '|', 'ç', '%', '&', ' ' }
|
||||
mail_cut = mail.split('@')
|
||||
tld = mail_cut[-1].split('.')
|
||||
|
||||
for character in invalid_char:
|
||||
if character in mail:
|
||||
valid=False
|
||||
|
||||
print(tld)
|
||||
if len(mail_cut) > 1 and len(tld) > 1 and valid:
|
||||
if len(tld[0]) < 1 or len(tld[-1]) < 2 :
|
||||
valid=False
|
||||
else:
|
||||
valid=False
|
||||
|
||||
return valid
|
||||
|
||||
|
||||
def valid_username(username):
|
||||
valid=True
|
||||
# Caractères non autorisés dans la RFC #822
|
||||
|
||||
Reference in New Issue
Block a user