String admin id compare to see if they can access /admin point

This commit is contained in:
Jeremy Zhang 2018-01-24 06:14:37 +00:00
parent 078ddaae6a
commit 4197c34cf4

View File

@ -16,7 +16,7 @@ def is_admin(f):
def decorated_function(*args, **kwargs): def decorated_function(*args, **kwargs):
if 'user_id' not in session: if 'user_id' not in session:
return redirect(url_for("index")) return redirect(url_for("index"))
if session['user_id'] not in get_administrators_list(): if str(session['user_id']) not in get_administrators_list():
return redirect(url_for("index")) return redirect(url_for("index"))
return f(*args, **kwargs) return f(*args, **kwargs)
return decorated_function return decorated_function