From 03587fa4cd1404deeb269e1939b70e6e162370a4 Mon Sep 17 00:00:00 2001 From: lemon <601749122@qq.com> Date: Wed, 18 Nov 2020 08:51:05 +0800 Subject: [PATCH 1/2] close_user_create_subject --- templates/subject.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/subject.html b/templates/subject.html index 8c11bf4..a86d00e 100644 --- a/templates/subject.html +++ b/templates/subject.html @@ -59,11 +59,12 @@

You are in {{ url }}

- -

+
+ {% if session.get('logged_in') %} add main subject + {% endif %}

From bd4672b2d3a00ea3b245ee3ae7846bd8c38682c3 Mon Sep 17 00:00:00 2001 From: lemon <601749122@qq.com> Date: Tue, 1 Dec 2020 09:03:07 +0800 Subject: [PATCH 2/2] modify service to close user create subject --- service.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service.py b/service.py index eaaa24e..af5395e 100644 --- a/service.py +++ b/service.py @@ -397,6 +397,8 @@ def find_subjects(subject, count): # ================================================================================ @app.route('/edit_subcategory', methods=['GET', 'POST']) def add_sub_category(): + if not session.get('logged_in'): + return render_template('login.html') if request.method == 'POST': subject_id = request.form['subject_id'] subject_name = request.form['subject_name']