Rename parameter.

This commit is contained in:
Alexis Lahouze 2017-05-13 11:17:41 +02:00
parent 08bc80aa82
commit d013e4cda8

View File

@ -40,10 +40,10 @@ def load_user_from_auth(auth):
return load_user_from_token(token) return load_user_from_token(token)
def requires_auth(f): def requires_auth(func):
@wraps(f)
"""Decorator to check user authentication before handling a request.""" """Decorator to check user authentication before handling a request."""
@wraps(func)
def wrapped(*args, **data): def wrapped(*args, **data):
"""Check user authentication from requests headers and return 401 if """Check user authentication from requests headers and return 401 if
unauthorized.""" unauthorized."""
@ -56,7 +56,7 @@ def requires_auth(f):
if user: if user:
g.user = user g.user = user
return f(*args, **data) return func(*args, **data)
ns.abort( ns.abort(
401, 401,