Fix issue #24
This commit is contained in:
parent
980d81324c
commit
f87a14b2da
3 changed files with 4 additions and 6 deletions
|
@ -52,10 +52,6 @@ app.register_blueprint(project_routes)
|
||||||
|
|
||||||
auto = Autodoc(app)
|
auto = Autodoc(app)
|
||||||
|
|
||||||
@app.errorhandler(404)
|
|
||||||
def page_not_found(e):
|
|
||||||
return app.send_static_file('views/404/index.html')
|
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def wellcomePage():
|
def wellcomePage():
|
||||||
return app.send_static_file('index.html')
|
return app.send_static_file('index.html')
|
||||||
|
|
|
@ -79,7 +79,6 @@ def create_campus(token):
|
||||||
except Exception:
|
except Exception:
|
||||||
return bad_request()
|
return bad_request()
|
||||||
|
|
||||||
|
|
||||||
send_create_campus_request(user.email, user.name, campus.title)
|
send_create_campus_request(user.email, user.name, campus.title)
|
||||||
notify_se_hub_campus_request(campus, campus.title)
|
notify_se_hub_campus_request(campus, campus.title)
|
||||||
return ok()
|
return ok()
|
||||||
|
|
|
@ -25,7 +25,7 @@ from SE_API.Respones_Utils import *
|
||||||
user_routes = Blueprint("user_routes", __name__)
|
user_routes = Blueprint("user_routes", __name__)
|
||||||
auto = Autodoc()
|
auto = Autodoc()
|
||||||
|
|
||||||
|
@user_routes.route('/api/users/getUserByToken/', defaults={'token': None})
|
||||||
@user_routes.route('/api/users/getUserByToken/<string:token>', methods=["GET"])
|
@user_routes.route('/api/users/getUserByToken/<string:token>', methods=["GET"])
|
||||||
@auto.doc()
|
@auto.doc()
|
||||||
def getUserByToken(token):
|
def getUserByToken(token):
|
||||||
|
@ -59,6 +59,9 @@ def getUserByToken(token):
|
||||||
<br>
|
<br>
|
||||||
403 - No User Found
|
403 - No User Found
|
||||||
"""
|
"""
|
||||||
|
if token is None:
|
||||||
|
return no_content("Token Is Empty, No User Found")
|
||||||
|
|
||||||
query = User.all()
|
query = User.all()
|
||||||
query.filter("seToken =", token)
|
query.filter("seToken =", token)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue