def METHOD_NAME(f):
    @wraps(f)
    def view_disabled_if_auth_is_delegated(request, *args, **kwargs):
        if request.settings.enable_oauth2_client:
            raise PermissionDenied(
                pgettext(
                    "auth api",
                    "This feature has been disabled. Please use %(provider)s to sign in.",
                )
                % {"provider": request.settings.oauth2_provider}
            )
        return f(request, *args, **kwargs)
    return view_disabled_if_auth_is_delegated