def require_api_access(view_func):
 @wraps(view_func)
 def wrapped_view(view_obj, *args, **kwargs):
  'Wrapper for the view function.'
  if ApiAccessRequest.has_api_access(args[0].user):
   return view_func(view_obj, *args, **kwargs)
  return redirect(reverse('api_admin:api-request'))
 return wrapped_view

def require_api_access ( view_func ) : @ wraps ( view_func ) def wrapped_view ( view_obj , * args , ** kwargs ) : if ApiAccessRequest . has_api_access ( args [ 0 ] . user ) : return view_func ( view_obj , * args , ** kwargs ) return redirect ( reverse ( 'api_admin:api-request' ) ) return wrapped_view
if the requesting user does not have api access .