Merge pull request 'ajout vérification date d'expiration' (#165) from jmplace/ScoDoc-Lille:controle_date_exp_anterieure into master

Reviewed-on: https://scodoc.org/git/viennet/ScoDoc/pulls/165
This commit is contained in:
Emmanuel Viennet 2021-10-16 10:19:14 +02:00
commit c05e763900

View File

@ -436,6 +436,9 @@ def create_user_form(user_name=None, edit=0, all_roles=1):
vals["date_expiration"] = datetime.datetime.strptime( vals["date_expiration"] = datetime.datetime.strptime(
vals["date_expiration"], "%d/%m/%Y" vals["date_expiration"], "%d/%m/%Y"
) )
if vals["date_expiration"] < datetime.datetime.now():
H.append(tf_error_message("date expiration passée"))
return "\n".join(H) + "\n" + tf[1] + F
else: else:
vals["date_expiration"] = None vals["date_expiration"] = None
except ValueError: except ValueError: