Merge pull request #124 from timfeirg/master

set user object id after created
This commit is contained in:
Khanh Ngo 2016-08-23 10:30:15 +07:00 committed by GitHub
commit 7f8374553a

View File

@ -268,6 +268,7 @@ class User(db.Model):
user = User(username=self.username, firstname=self.firstname, lastname=self.lastname, role_id=self.role_id, email=self.email, password=self.get_hashed_password(self.plain_text_password))
db.session.add(user)
db.session.commit()
self.id = user.id
return True
except Exception, e:
raise