From b9b8111464bd43c65b3fba150f7c2cd8a65ace11 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 6 Apr 2024 10:09:39 +0200 Subject: [PATCH] fix 500 error --- files/routes/chat.py | 2 -- files/routes/chats.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/files/routes/chat.py b/files/routes/chat.py index 8854d5198..3b496097c 100644 --- a/files/routes/chat.py +++ b/files/routes/chat.py @@ -57,8 +57,6 @@ def commit_and_close(): g.db.close() stdout.flush() -CHAT_ERROR_MESSAGE = f"To prevent spam, you'll need {TRUESCORE_MINIMUM} truescore (this is {TRUESCORE_MINIMUM} votes, either up or down, on any threads or comments you've made) in order to access chat. Sorry! I love you 💖" - @app.post('/refresh_chat') def refresh_chat(): emit('refresh_chat', namespace='/', to=f'{SITE_FULL}/chat/1') diff --git a/files/routes/chats.py b/files/routes/chats.py index b1ec05d74..dbb5e381d 100644 --- a/files/routes/chats.py +++ b/files/routes/chats.py @@ -65,7 +65,7 @@ def chat(v, chat_id): if chat.id == 1: if not v.allowed_in_chat: - abort(403, CHAT_ERROR_MESSAGE) + abort(403, f"To prevent spam, you'll need {TRUESCORE_MINIMUM} truescore (this is {TRUESCORE_MINIMUM} votes, either up or down, on any threads or comments you've made) in order to access chat. Sorry! I love you 💖") else: membership = g.db.query(ChatMembership).filter_by(user_id=v.id, chat_id=chat_id).one_or_none() if v.admin_level < PERMS['VIEW_CHATS'] and not membership: