From f9c999137021f24ccf1c6061c15bdcce7eb84b65 Mon Sep 17 00:00:00 2001 From: freamon Date: Fri, 17 Jan 2025 08:17:14 +0000 Subject: [PATCH] bugfix for blocked phrases --- app/utils.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/utils.py b/app/utils.py index 28ee7b6b..328d382b 100644 --- a/app/utils.py +++ b/app/utils.py @@ -557,7 +557,14 @@ def blocked_users(user_id) -> List[int]: def blocked_phrases() -> List[str]: site = Site.query.get(1) if site.blocked_phrases: - return [phrase for phrase in site.blocked_phrases.split('\n') if phrase != ''] + blocked_phrases = [] + for phrase in site.blocked_phrases.split('\n'): + if phrase != '': + if phrase.endswith('\r'): + blocked_phrases.append(phrase[:-1]) + else: + blocked_phrases.append(phrase) + return blocked_phrases else: return []