diff options
Diffstat (limited to 'apioforum/forum.py')
-rw-r--r-- | apioforum/forum.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apioforum/forum.py b/apioforum/forum.py index 3d7611b..ca656ff 100644 --- a/apioforum/forum.py +++ b/apioforum/forum.py @@ -423,11 +423,13 @@ def search(): FROM posts_fts JOIN posts ON posts_fts.rowid = posts.id JOIN threads ON threads.id = posts.thread - WHERE posts_fts MATCH ? + JOIN public_posts ON public_posts.id = posts.id + WHERE posts_fts MATCH ? AND public_posts.public ORDER BY rank LIMIT 50 """, (query,)).fetchall() - except OperationalError: + except OperationalError as e: + print(e) flash('your search query was malformed.') return redirect(url_for("forum.not_actual_index")) |