From 5e507fbb5ec514a31ac2b028a63a6fc219042109 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 3 Feb 2019 01:56:44 +0100 Subject: [PATCH] idk i think this might work but i'm too sleepy to check --- templates/wikipage.html | 2 +- webserver.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/wikipage.html b/templates/wikipage.html index 1ac06bd7..2bd39d64 100644 --- a/templates/wikipage.html +++ b/templates/wikipage.html @@ -43,7 +43,7 @@ Ultima modifica di {{ wiki_log.editor.username }} alle {{ wiki_log.timestamp.strftime('%Y-%m-%d %H:%M:%S %Z') }}{% if wiki_log.reason %}, motivo: {{ wiki_log.reason }}{% endif %} {% endif %} - {% if g.user %} + {% if g.user and not wiki_page.locked %}

Modifica

diff --git a/webserver.py b/webserver.py index c8f09661..9e5eb25d 100644 --- a/webserver.py +++ b/webserver.py @@ -260,6 +260,9 @@ def page_wiki(key: str): elif request.method == "POST": if not fl_g.user: return redirect(url_for("page_login")) + if wiki_page.locked: + abort(403) + return user = fl_g.session.query(db.Royal).filter_by(id=fl_g.user.id).one() new_content = request.form.get("content") # Create new page