From d0e0396528c55f1b61c1d48452e855ea69ec3e89 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Thu, 14 Jan 2021 17:49:37 -0600 Subject: [PATCH] Hack to fix tests not passing. Unclear why the filters are being set to nil. Both of these changes are needed or it doesn't work. --- lib/pleroma/upload/filter.ex | 2 ++ test/support/data_case.ex | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/upload/filter.ex b/lib/pleroma/upload/filter.ex index 661135634..367acd214 100644 --- a/lib/pleroma/upload/filter.ex +++ b/lib/pleroma/upload/filter.ex @@ -43,4 +43,6 @@ defmodule Pleroma.Upload.Filter do error end end + + def filter(nil, upload), do: filter([], upload) end diff --git a/test/support/data_case.ex b/test/support/data_case.ex index 0b41f0f63..23c858d2a 100644 --- a/test/support/data_case.ex +++ b/test/support/data_case.ex @@ -107,7 +107,7 @@ defmodule Pleroma.DataCase do def ensure_local_uploader(context) do test_uploader = Map.get(context, :uploader, Pleroma.Uploaders.Local) uploader = Pleroma.Config.get([Pleroma.Upload, :uploader]) - filters = Pleroma.Config.get([Pleroma.Upload, :filters]) + filters = Pleroma.Config.get([Pleroma.Upload, :filters]) || [] Pleroma.Config.put([Pleroma.Upload, :uploader], test_uploader) Pleroma.Config.put([Pleroma.Upload, :filters], []) -- 2.45.2