From cdccc32a6391fe1e2727920fe70661bd97fc4f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 27 Jul 2017 00:05:51 +0200 Subject: [PATCH] Use atexit to sleep issue6651 review43321002 --- user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user.py b/user.py index 5930b90f33..4fe1a0fad4 100644 --- a/user.py +++ b/user.py @@ -168,7 +168,7 @@ class User(ModelSQL, ModelView): email = email.lower() # Prevent brute force attack - time.sleep(2 ** Attempt.count(email) - 1) + Transaction().atexit(time.sleep, 2 ** Attempt.count(email) - 1) users = cls.search([('email', '=', email)]) if users: @@ -333,7 +333,7 @@ class User(ModelSQL, ModelView): email = email.lower() # Prevent brute force attack - time.sleep(2 ** Attempt.count(email) - 1) + Transaction().atexit(time.sleep, 2 ** Attempt.count(email) - 1) users = cls.search([ ('email', '=', email),