From 87cf4d13ff6d326a6899d63d4a9413b136070a75 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 7 Nov 2022 02:22:06 +0200 Subject: [PATCH] add cc post search parameter --- files/routes/search.py | 8 ++++++++ files/templates/search.html | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/files/routes/search.py b/files/routes/search.py index fd6318e18..8933ae04d 100644 --- a/files/routes/search.py +++ b/files/routes/search.py @@ -18,6 +18,7 @@ valid_params = [ 'before', 'after', 'title', + 'cc', search_operator_hole, ] @@ -140,6 +141,13 @@ def searchposts(v): except: abort(400) posts = posts.filter(Submission.created_utc < before) + if 'cc' in criteria: + cc = criteria['cc'].lower().strip() + if cc == 'true': cc = True + elif cc == 'false': cc = False + else: abort(400) + posts = posts.filter(Submission.club == cc) + posts = apply_time_filter(t, posts, Submission) posts = sort_objects(sort, posts, Submission, diff --git a/files/templates/search.html b/files/templates/search.html index bd80ed855..c919e67f7 100644 --- a/files/templates/search.html +++ b/files/templates/search.html @@ -75,6 +75,10 @@
Post Title Only:
+
+
Country Club:
+ +
{% endif %}