remove now-unused code

pull/225/head
Aevann 2024-02-28 22:00:38 +02:00
parent 167377ab83
commit ccc201b3a1
1 changed files with 1 additions and 8 deletions

View File

@ -90,14 +90,7 @@ def searchposts(v):
), 403
posts = posts.filter(Post.author_id == author.id)
if 'exact' in criteria and 'full_text' in criteria:
regex_str = '[[:<:]]'+criteria['full_text']+'[[:>:]]' # https://docs.oracle.com/cd/E17952_01/mysql-5.5-en/regexp.html "word boundaries"
if 'title' in criteria:
words = [Post.title.regexp_match(regex_str)]
else:
words = [or_(Post.title.regexp_match(regex_str), Post.body.regexp_match(regex_str))]
posts = posts.filter(*words)
elif 'q' in criteria:
if 'q' in criteria:
if 'title' in criteria:
words = [or_(Post.title.ilike('%'+x+'%')) \
for x in criteria['q']]