def change_password(self, password): self.password = bc.generate_password_hash(password).decode('utf-8')
def create_user(cls, username, password): hashed_pw = bc.generate_password_hash(password).decode('utf-8') new_user = cls(username=username, password=hashed_pw) db.session.add(new_user) db.session.commit()
def create_model(self, form): form.password.data = bc.generate_password_hash(form.password.data) super().create_model(form)