Add rest of user model fields to api.

First step to moving user interactions to api.
This commit is contained in:
Adam Shimali
2016-01-19 11:38:29 +00:00
parent 6c7fb42272
commit f839bae1f5
10 changed files with 193 additions and 48 deletions

View File

@@ -8,7 +8,8 @@ from app.models import User
def save_model_user(usr, update_dict={}):
if update_dict:
del update_dict['id']
if update_dict.get('id'):
del update_dict['id']
db.session.query(User).filter_by(id=usr.id).update(update_dict)
else:
db.session.add(usr)