diff --git a/SE_API/UserRoutes.py b/SE_API/UserRoutes.py index f1e9382..4073229 100644 --- a/SE_API/UserRoutes.py +++ b/SE_API/UserRoutes.py @@ -83,8 +83,8 @@ def updateUser(token): Payload
- JSON Object, Example:
{
- 'name': 'Campus name',
- 'isLecturer': '@campus.ac.com',
+ 'name': 'new name',
+ 'isLecturer': true
}

Response @@ -100,23 +100,24 @@ def updateUser(token): try: payload = json.loads(request.data) except Exception as e: - return bad_request(e) + return bad_request() user = get_user_by_token(token) if user is None: return bad_request("Not a user!") try: - user.name = payload['user'] + user.name = payload['name'] except Exception: pass try: user.isLecturer = payload['isLecturer'] - except Exception: - pass - + except Exception as e: + print e + db.put(user) + db.save return ok("User updated")