mirror of
https://github.com/bunkerity/bunkerized-nginx
synced 2023-12-13 21:30:18 +01:00
Refactor User class to use property decorator for
password_hash
This commit is contained in:
parent
c1e25a64af
commit
bf5dadb431
1 changed files with 1 additions and 2 deletions
|
@ -1,6 +1,5 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
from functools import cached_property
|
||||
from typing import Optional
|
||||
from flask_login import UserMixin
|
||||
from bcrypt import checkpw, hashpw, gensalt
|
||||
|
@ -15,7 +14,7 @@ class User(UserMixin):
|
|||
|
||||
self.__password = password_hash or hashpw(password.encode("utf-8"), gensalt()) # type: ignore
|
||||
|
||||
@cached_property
|
||||
@property
|
||||
def password_hash(self) -> bytes:
|
||||
"""
|
||||
Get the password hash
|
||||
|
|
Loading…
Reference in a new issue