forked from MarseyWorld/MarseyWorld
loudly tell users they can't do this while suspended
parent
00ee6d508d
commit
940f815f84
|
@ -129,18 +129,11 @@ def auth_required(f):
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
def is_not_permabanned(f):
|
def is_not_permabanned(f):
|
||||||
|
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
|
|
||||||
v = get_logged_in_user()
|
v = get_logged_in_user()
|
||||||
|
|
||||||
if not v: abort(401)
|
if not v: abort(401)
|
||||||
|
if v.is_suspended_permanently: abort(403)
|
||||||
if v.is_suspended_permanently:
|
|
||||||
return {"error": "Internal server error"}, 500
|
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue