From ff8de2066788345b7a4d3c04b694d1d81f184af4 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 9 Jan 2019 00:32:22 +0100 Subject: [PATCH] buuuuuuuuuugfix --- webserver.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/webserver.py b/webserver.py index c7b2e7df..aafeb22d 100644 --- a/webserver.py +++ b/webserver.py @@ -56,7 +56,7 @@ def markdown(text): def require_login(f): @functools.wraps(f) def func(*args, **kwargs): - if not fl_g.logged_in: + if not fl_g.user: abort(403) return return f(*args, **kwargs) @@ -184,9 +184,6 @@ def page_password(): @app.route("/editprofile", methods=["GET", "POST"]) @require_login def page_editprofile(): - if not fl_g.logged_in: - abort(403) - return profile_data = fl_g.session.query(db.ProfileData).filter_by(royal_id=fl_g.user_id).join(db.Royal).one_or_none() if request.method == "GET": return render_template("profileedit.html", data=profile_data) @@ -295,9 +292,9 @@ def page_wiki(key: str): return render_template("wikipage.html", key=key, wiki_page=wiki_page, converted_md=Markup(converted_md), wiki_log=wiki_latest_edit) elif request.method == "POST": - if not fl_g.logged_in: + if not fl_g.user: return redirect(url_for("page_login")) - user = fl_g.session.query(db.Royal).filter_by(id=fl_g.user_id).one() + user = fl_g.session.query(db.Royal).filter_by(id=fl_g.user.id).one() new_content = request.form.get("content") # Create new page if wiki_page is None: