Fix some deprecations and factor out a helper function (#387)

This commit is contained in:
FatherInire 2022-10-28 14:15:48 +11:00 committed by GitHub
parent 4bdfe28a35
commit b46ada9f72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 59 additions and 44 deletions

View file

@ -334,7 +334,7 @@ def frontlist(v=None, sort='new', page=1, t="all", ids_only=True, ccmode="false"
if v and filter_words:
for word in filter_words:
word = word.replace('\\', '').replace('_', '\_').replace('%', '\%').strip()
word = word.replace(r'\\', '').replace('_', r'\_').replace('%', r'\%').strip()
posts=posts.filter(not_(Submission.title.ilike(f'%{word}%')))
if not (v and v.shadowbanned):