forked from rDrama/rDrama
fix missing required context variables on 429 and remove flex tape
parent
b6eea4191c
commit
f2411415dd
|
@ -25,6 +25,7 @@ from files.__main__ import app
|
|||
@app.errorhandler(418)
|
||||
@app.errorhandler(429)
|
||||
def error(e):
|
||||
g.desires_auth = False
|
||||
title = ERROR_TITLES.get(e.code, str(e.code))
|
||||
msg = ERROR_MSGS.get(e.code, str(e.code))
|
||||
details = e.description
|
||||
|
|
|
@ -49,7 +49,7 @@ def calc_users():
|
|||
loggedout_counter = 0
|
||||
loggedin_chat = 0
|
||||
v = getattr(g, 'v', None) if g else None
|
||||
if has_request_context and g and getattr(g, 'desires_auth', False) and not getattr(g, 'is_api_or_xhr', True):
|
||||
if has_request_context and g and g.desires_auth and not g.is_api_or_xhr:
|
||||
loggedin = cache.get(LOGGED_IN_CACHE_KEY) or {}
|
||||
loggedout = cache.get(LOGGED_OUT_CACHE_KEY) or {}
|
||||
loggedin_chat = cache.get(CHAT_ONLINE_CACHE_KEY) or 0
|
||||
|
|
Loading…
Reference in New Issue