mirror of
https://github.com/Mailu/Mailu.git
synced 2025-02-15 13:33:21 +02:00
Remove is_enabled method and use the enabled attribute instead
This commit is contained in:
parent
3b66fcada7
commit
733b89bff5
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user