minor reorder

master
Aevann 2023-09-14 20:20:44 +03:00
parent 34de9cba44
commit 4cafef23fd
1 changed files with 9 additions and 9 deletions

View File

@ -44,15 +44,6 @@ online = {
cache.set(CHAT_ONLINE_CACHE_KEY, len(online[f'{SITE_FULL}/chat']), timeout=0) cache.set(CHAT_ONLINE_CACHE_KEY, len(online[f'{SITE_FULL}/chat']), timeout=0)
def is_not_banned_socketio(f):
def wrapper(*args, **kwargs):
v = get_logged_in_user()
if not v: return '', 401
if v.is_suspended: return '', 403
return make_response(f(*args, v=v, **kwargs))
wrapper.__name__ = f.__name__
return wrapper
def auth_required_socketio(f): def auth_required_socketio(f):
def wrapper(*args, **kwargs): def wrapper(*args, **kwargs):
v = get_logged_in_user() v = get_logged_in_user()
@ -62,6 +53,15 @@ def auth_required_socketio(f):
wrapper.__name__ = f.__name__ wrapper.__name__ = f.__name__
return wrapper return wrapper
def is_not_banned_socketio(f):
def wrapper(*args, **kwargs):
v = get_logged_in_user()
if not v: return '', 401
if v.is_suspended: return '', 403
return make_response(f(*args, v=v, **kwargs))
wrapper.__name__ = f.__name__
return wrapper
CHAT_ERROR_MESSAGE = f"To prevent spam, you'll need {TRUESCORE_CC_CHAT_MINIMUM} truescore (this is {TRUESCORE_CC_CHAT_MINIMUM} votes, either up or down, on any threads or comments you've made) in order to access chat. Sorry! I love you 💖" CHAT_ERROR_MESSAGE = f"To prevent spam, you'll need {TRUESCORE_CC_CHAT_MINIMUM} truescore (this is {TRUESCORE_CC_CHAT_MINIMUM} votes, either up or down, on any threads or comments you've made) in order to access chat. Sorry! I love you 💖"
@app.get("/chat") @app.get("/chat")