added option to change campus name

This commit is contained in:
Aran Zaiger 2015-06-16 22:42:15 +03:00
parent 4bb17157d0
commit a29e9bce46
2 changed files with 8 additions and 1 deletions

View file

@ -84,7 +84,8 @@ def updateUser(token):
- JSON Object, Example: <br> - JSON Object, Example: <br>
{<br> {<br>
'name': 'new name',<br> 'name': 'new name',<br>
'isLecturer': true<br> 'isLecturer': true,<br>
'campusName': 'JCE'<br>
}<br> }<br>
<br> <br>
<b>Response</b> <b>Response</b>
@ -111,6 +112,11 @@ def updateUser(token):
except Exception: except Exception:
pass pass
try:
user.campusName = payload['campusName']
except Exception:
pass
try: try:
user.isLecturer = payload['isLecturer'] user.isLecturer = payload['isLecturer']
except Exception as e: except Exception as e:

View file

@ -12,6 +12,7 @@ class User(db.Model):
seToken = db.StringProperty(required=True) seToken = db.StringProperty(required=True)
avatar_url = db.StringProperty(required=True) avatar_url = db.StringProperty(required=True)
isFirstLogin = db.BooleanProperty(default=True) isFirstLogin = db.BooleanProperty(default=True)
campusName = db.StringProperty(required=True, default="")
campuses_id_list = db.StringListProperty(default=[]) campuses_id_list = db.StringListProperty(default=[])
classes_id_list = db.StringListProperty(default=[]) classes_id_list = db.StringListProperty(default=[])