From b5e446b82907a37a5af6ab5b7e70a377208b21f3 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 12 Sep 2021 03:41:48 +0200 Subject: [PATCH] gf --- .gitignore | 2 +- files/routes/admin.py | 6 +++--- files/routes/static.py | 4 ++-- files/templates/norules.html | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 3a8e29473..bb37da3e3 100644 --- a/.gitignore +++ b/.gitignore @@ -114,4 +114,4 @@ local.txt *.scssc .idea/* disablesignups -/*rules.md \ No newline at end of file +/*rules.html \ No newline at end of file diff --git a/files/routes/admin.py b/files/routes/admin.py index 12d38df5f..87d422b76 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -147,7 +147,7 @@ def monthly(v): def get_rules(v): try: - with open(f'./{SITE_NAME} rules.md', 'r') as f: + with open(f'./{SITE_NAME} rules.html', 'r') as f: rules = f.read() except Exception: rules = None @@ -162,10 +162,10 @@ def post_rules(v): text = request.form.get('rules', '') - with open(f'./{SITE_NAME} rules.md', 'w+') as f: + with open(f'./{SITE_NAME} rules.html', 'w+') as f: f.write(text) - with open(f'./{SITE_NAME} rules.md', 'r') as f: + with open(f'./{SITE_NAME} rules.html', 'r') as f: rules = f.read() return render_template('admin/rules.html', v=v, rules=rules) diff --git a/files/routes/static.py b/files/routes/static.py index 94e8554d7..1d448394e 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -13,13 +13,13 @@ site_name = environ.get("SITE_NAME").strip() @auth_desired def static_rules(v): - if not path.exists('./rules.md'): + if not path.exists(f'./{site_name} rules.html'): if v and v.admin_level == 6: return render_template('norules.html', v=v) else: abort(404) - with open('./rules.md', 'r') as f: + with open(f'./{site_name} rules.html', 'r') as f: rules = f.read() return render_template('rules.html', rules=rules, v=v) diff --git a/files/templates/norules.html b/files/templates/norules.html index 4c8db1161..51c2a2218 100644 --- a/files/templates/norules.html +++ b/files/templates/norules.html @@ -1,7 +1,7 @@ {% extends "default.html" %} {% block title %} -not configured +Not configured {% endblock %} {% block pagetype %}message{% endblock %}