Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User2(UserMixin,db.Model):
- id = db.Column(db.Integer, primary_key=True)
- username = db.Column(db.String(80), unique=False, nullable=False)
- password_hash = db.Column(db.String(30), unique=False, nullable=False)
- @property
- def password(self):
- raise AttributeError('password is not a readable attribute')
- @password.setter
- def password(self, password):
- self.password_hash = generate_password_hash(password)
- def verify_password(self, password):
- return check_password_hash(self.password_hash, password)
- p = request.form.get("password")
- if t is not None and User2.verify_password(p):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement