fix 500 error

master
Aevann 2023-09-28 23:47:24 +03:00
parent 57d16ba95e
commit fe981e97d6
1 changed files with 8 additions and 2 deletions

View File

@ -49,7 +49,10 @@ def auth_required_socketio(f):
v = get_logged_in_user() v = get_logged_in_user()
if not v: return '', 401 if not v: return '', 401
if v.is_permabanned: return '', 403 if v.is_permabanned: return '', 403
g.referrer = request.referrer.split('?')[0] if request.referrer:
g.referrer = request.referrer.split('?')[0]
else:
g.referrer = None
return make_response(f(*args, v=v, **kwargs)) return make_response(f(*args, v=v, **kwargs))
wrapper.__name__ = f.__name__ wrapper.__name__ = f.__name__
return wrapper return wrapper
@ -59,7 +62,10 @@ def is_not_banned_socketio(f):
v = get_logged_in_user() v = get_logged_in_user()
if not v: return '', 401 if not v: return '', 401
if v.is_suspended: return '', 403 if v.is_suspended: return '', 403
g.referrer = request.referrer.split('?')[0] if request.referrer:
g.referrer = request.referrer.split('?')[0]
else:
g.referrer = None
return make_response(f(*args, v=v, **kwargs)) return make_response(f(*args, v=v, **kwargs))
wrapper.__name__ = f.__name__ wrapper.__name__ = f.__name__
return wrapper return wrapper