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.
This commit is contained in:
Mark Felder 2021-01-14 17:49:37 -06:00
parent 0b725f5d21
commit d0e0396528
2 changed files with 3 additions and 1 deletions

View file

@ -43,4 +43,6 @@ def filter([filter | rest], upload) do
error error
end end
end end
def filter(nil, upload), do: filter([], upload)
end end

View file

@ -107,7 +107,7 @@ def stub_pipeline do
def ensure_local_uploader(context) do def ensure_local_uploader(context) do
test_uploader = Map.get(context, :uploader, Pleroma.Uploaders.Local) test_uploader = Map.get(context, :uploader, Pleroma.Uploaders.Local)
uploader = Pleroma.Config.get([Pleroma.Upload, :uploader]) 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, :uploader], test_uploader)
Pleroma.Config.put([Pleroma.Upload, :filters], []) Pleroma.Config.put([Pleroma.Upload, :filters], [])