loudly tell users they can't do this while suspended

master
justcool393 2022-10-10 23:15:09 -07:00
parent 00ee6d508d
commit 940f815f84
1 changed files with 1 additions and 8 deletions

View File

@ -129,18 +129,11 @@ def auth_required(f):
return wrapper
def is_not_permabanned(f):
def wrapper(*args, **kwargs):
v = get_logged_in_user()
if not v: abort(401)
if v.is_suspended_permanently:
return {"error": "Internal server error"}, 500
if v.is_suspended_permanently: abort(403)
return make_response(f(*args, v=v, **kwargs))
wrapper.__name__ = f.__name__
return wrapper