diff --git a/lib/pleroma/config/deprecation_warnings.ex b/lib/pleroma/config/deprecation_warnings.ex index df41b0441..5ce545959 100644 --- a/lib/pleroma/config/deprecation_warnings.ex +++ b/lib/pleroma/config/deprecation_warnings.ex @@ -23,7 +23,10 @@ defmodule Pleroma.Config.DeprecationWarnings do def check_simple_policy_tuples do has_strings = Config.get([:mrf_simple]) - |> Enum.map(fn {_, v} -> v == [] || Enum.max(v) end) + |> Enum.map(fn + {_, []} -> {} + {_, v} -> Enum.max(v) + end) |> Enum.max() |> is_binary @@ -76,7 +79,7 @@ def check_simple_policy_tuples do Config.put([:mrf_simple], new_config) - :ok + :error else :ok end diff --git a/test/config/deprecation_warnings_test.exs b/test/config/deprecation_warnings_test.exs index ff230db05..b85f903e5 100644 --- a/test/config/deprecation_warnings_test.exs +++ b/test/config/deprecation_warnings_test.exs @@ -22,7 +22,6 @@ test "gives warning when there are still strings" do reject_deletes: ["some.reject.deletes"] ) - # TODO: Can I take the actual config and new config instead? Note that it'll need to be clear where you put the reason. assert capture_log(fn -> DeprecationWarnings.check_simple_policy_tuples() end) =~ """ !!!DEPRECATION WARNING!!!