#233. Make sure password hash is string before inserting to the db

This commit is contained in:
Khanh Ngo 2018-04-06 18:05:38 +07:00
parent 0826702537
commit fc4e9dc9a0

View File

@ -315,6 +315,7 @@ class User(db.Model):
self.role_id = Role.query.filter_by(name='Administrator').first().id
self.password = self.get_hashed_password(self.plain_text_password)
self.password = self.password.decode("utf-8")
db.session.add(self)
db.session.commit()