From a29e9bce4628b863aa616b52c503440cae7107f7 Mon Sep 17 00:00:00 2001 From: aranzaiger Date: Tue, 16 Jun 2015 22:42:15 +0300 Subject: [PATCH] added option to change campus name --- SE_API/UserRoutes.py | 8 +++++++- models/User.py | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) 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=[])