decorator: Rename profile to user_profile.

This is more consistent with how we name UserProfile objects.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
Zixuan James Li
2022-08-17 10:25:02 -04:00
committed by Tim Abbott
parent de22b72670
commit 1e8cb0e7b1

View File

@@ -744,7 +744,7 @@ def authenticated_rest_api_view(
# Now we try to do authentication or die
try:
profile = validate_api_key(
user_profile = validate_api_key(
request,
role,
api_key,
@@ -755,8 +755,8 @@ def authenticated_rest_api_view(
raise UnauthorizedError(e.msg)
try:
if not skip_rate_limiting:
rate_limit_user(request, profile, domain="api_by_user")
return view_func(request, profile, *args, **kwargs)
rate_limit_user(request, user_profile, domain="api_by_user")
return view_func(request, user_profile, *args, **kwargs)
except Exception as err:
if not webhook_client_name:
raise err