Fix 2 filter_by bugs

Fixes #101
This commit is contained in:
rubenwardy
2018-07-13 21:28:08 +01:00
parent 1b42f3310a
commit 28ee65809e
4 changed files with 12 additions and 7 deletions

View File

@@ -27,8 +27,10 @@ from wtforms.validators import *
@app.route("/threads/")
def threads_page():
threads = Thread.query.filter_by(private=False).all()
return render_template("threads/list.html", threads=threads)
query = Thread.query
if not Permission.SEE_THREAD.check(current_user):
query = query.filter_by(private=False)
return render_template("threads/list.html", threads=query.all())
@app.route("/threads/<int:id>/", methods=["GET", "POST"])
def thread_page(id):