From f87a14b2da4768979fb0e99ba522d53db44950f4 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Wed, 17 Jun 2015 20:07:20 +0300 Subject: [PATCH] Fix issue #24 --- SE_API/API.py | 4 ---- SE_API/CampusRoutes.py | 1 - SE_API/UserRoutes.py | 5 ++++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/SE_API/API.py b/SE_API/API.py index 972c39e..387ba41 100644 --- a/SE_API/API.py +++ b/SE_API/API.py @@ -52,10 +52,6 @@ app.register_blueprint(project_routes) auto = Autodoc(app) -@app.errorhandler(404) -def page_not_found(e): - return app.send_static_file('views/404/index.html') - @app.route('/') def wellcomePage(): return app.send_static_file('index.html') diff --git a/SE_API/CampusRoutes.py b/SE_API/CampusRoutes.py index 11af4b3..c52fe9c 100644 --- a/SE_API/CampusRoutes.py +++ b/SE_API/CampusRoutes.py @@ -79,7 +79,6 @@ def create_campus(token): except Exception: return bad_request() - send_create_campus_request(user.email, user.name, campus.title) notify_se_hub_campus_request(campus, campus.title) return ok() diff --git a/SE_API/UserRoutes.py b/SE_API/UserRoutes.py index 0bc26d1..d66fdea 100644 --- a/SE_API/UserRoutes.py +++ b/SE_API/UserRoutes.py @@ -25,7 +25,7 @@ from SE_API.Respones_Utils import * user_routes = Blueprint("user_routes", __name__) auto = Autodoc() - +@user_routes.route('/api/users/getUserByToken/', defaults={'token': None}) @user_routes.route('/api/users/getUserByToken/', methods=["GET"]) @auto.doc() def getUserByToken(token): @@ -59,6 +59,9 @@ def getUserByToken(token):
403 - No User Found """ + if token is None: + return no_content("Token Is Empty, No User Found") + query = User.all() query.filter("seToken =", token)