mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-05-20 02:28:07 +00:00
SimplePolicy reasons: handle legacy config
This commit is contained in:
parent
9983799ccb
commit
e72fd4ceb6
|
@ -104,7 +104,10 @@ defmodule Pleroma.Web.ActivityPub.MRF do
|
|||
|
||||
@spec instance_list_from_tuples([{String.t(), String.t()}]) :: [String.t()]
|
||||
def instance_list_from_tuples(list) do
|
||||
Enum.map(list, fn {instance, _} -> instance end)
|
||||
Enum.map(list, fn
|
||||
{instance, _} -> instance
|
||||
instance when is_binary(instance) -> instance
|
||||
end)
|
||||
end
|
||||
|
||||
def describe(policies) do
|
||||
|
|
|
@ -70,6 +70,13 @@ defmodule Pleroma.Web.ActivityPub.MRFTest do
|
|||
|
||||
assert MRF.instance_list_from_tuples(list) == expected
|
||||
end
|
||||
|
||||
test "it handles legacy config" do
|
||||
list = [{"some.tld", "a reason"}, "other.tld"]
|
||||
expected = ["some.tld", "other.tld"]
|
||||
|
||||
assert MRF.instance_list_from_tuples(list) == expected
|
||||
end
|
||||
end
|
||||
|
||||
describe "describe/0" do
|
||||
|
|
Loading…
Reference in a new issue