diff --git a/accountant/views/users.py b/accountant/views/users.py index a8d8fa9..7514b86 100644 --- a/accountant/views/users.py +++ b/accountant/views/users.py @@ -40,10 +40,10 @@ def load_user_from_auth(auth): return load_user_from_token(token) -def requires_auth(f): - @wraps(f) +def requires_auth(func): """Decorator to check user authentication before handling a request.""" + @wraps(func) def wrapped(*args, **data): """Check user authentication from requests headers and return 401 if unauthorized.""" @@ -56,7 +56,7 @@ def requires_auth(f): if user: g.user = user - return f(*args, **data) + return func(*args, **data) ns.abort( 401,