def __init__(self, **args):
     self.username = args['username']
     self.email = args['email']
     if 'avatar' in args:
         self.avatar = args['avatar']
     if 'password' in args:
         self.password = bcrypt.generate_password_hash(
             args['password']).decode("utf-8")
Ejemplo n.º 2
0
 def hash_password(self, password: str) -> "Users":
     self.password = bcrypt.generate_password_hash(password).decode("utf-8")
Ejemplo n.º 3
0
 def __init__(self, username: str, email: str, password: str):
     self.username = username
     self.email = email
     self.password = bcrypt.generate_password_hash(password).decode("utf-8")