diff --git a/SE_API/UserRoutes.py b/SE_API/UserRoutes.py index 4073229..ce51a1b 100644 --- a/SE_API/UserRoutes.py +++ b/SE_API/UserRoutes.py @@ -84,7 +84,8 @@ def updateUser(token): - JSON Object, Example:
{
'name': 'new name',
- 'isLecturer': true
+ 'isLecturer': true,
+ 'campusName': 'JCE'
}

Response @@ -111,6 +112,11 @@ def updateUser(token): except Exception: pass + try: + user.campusName = payload['campusName'] + except Exception: + pass + try: user.isLecturer = payload['isLecturer'] except Exception as e: diff --git a/models/User.py b/models/User.py index 8c3e330..d59e690 100644 --- a/models/User.py +++ b/models/User.py @@ -12,6 +12,7 @@ class User(db.Model): seToken = db.StringProperty(required=True) avatar_url = db.StringProperty(required=True) isFirstLogin = db.BooleanProperty(default=True) + campusName = db.StringProperty(required=True, default="") campuses_id_list = db.StringListProperty(default=[]) classes_id_list = db.StringListProperty(default=[])