From 733b89bff5b241b00034fa0cd0183fb710badd51 Mon Sep 17 00:00:00 2001 From: Stefan Auditor Date: Sun, 15 Apr 2018 13:42:08 +0200 Subject: [PATCH] Remove is_enabled method and use the enabled attribute instead --- core/admin/mailu/models.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/admin/mailu/models.py b/core/admin/mailu/models.py index 8d42ac2a..ef222327 100644 --- a/core/admin/mailu/models.py +++ b/core/admin/mailu/models.py @@ -221,9 +221,6 @@ class User(Base, Email): default=scheme_dict[app.config['PASSWORD_SCHEME']], ) - def is_enabled(self): - return self.enabled - def check_password(self, password): reference = re.match('({[^}]+})?(.*)', self.password).group(2) return User.pw_context.verify(password, reference) @@ -260,7 +257,7 @@ class User(Base, Email): @classmethod def login(cls, email, password): user = cls.query.get(email) - return user if (user and user.check_password(password) and user.is_enabled()) else None + return user if (user and user.enabled and user.check_password(password)) else None login_manager.user_loader(User.query.get)