bugfix for blocked phrases

This commit is contained in:
freamon 2025-01-17 08:17:14 +00:00
parent e85a0ddd9a
commit f9c9991370

View file

@ -557,7 +557,14 @@ def blocked_users(user_id) -> List[int]:
def blocked_phrases() -> List[str]: def blocked_phrases() -> List[str]:
site = Site.query.get(1) site = Site.query.get(1)
if site.blocked_phrases: 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: else:
return [] return []