From bd43ed4f7de063d120046d8d7d7d67d29f930fb7 Mon Sep 17 00:00:00 2001 From: Radek Janicki <13463966+rdk08@users.noreply.github.com> Date: Tue, 18 Apr 2023 12:48:09 +0200 Subject: [PATCH] Refactor if statement --- lib/plausible_web/controllers/api/external_controller.ex | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/plausible_web/controllers/api/external_controller.ex b/lib/plausible_web/controllers/api/external_controller.ex index b00bc00c0c64..db17f2d9e9ec 100644 --- a/lib/plausible_web/controllers/api/external_controller.ex +++ b/lib/plausible_web/controllers/api/external_controller.ex @@ -168,11 +168,7 @@ defmodule PlausibleWeb.Api.ExternalController do defp is_bot?(%UAInspector.Result.Bot{}), do: true defp is_bot?(%UAInspector.Result{client: %UAInspector.Result.Client{name: "Headless Chrome"}}) do - if Application.get_env(:plausible, :system_environment) in ["staging", "rc"] do - false - else - true - end + Application.get_env(:plausible, :system_environment) not in ["staging", "rc"] end defp is_bot?(_), do: false