forked from AkkomaGang/akkoma
Merge branch 'fix/1532-fix-for-migration-fe-setting' into 'develop'
Fix for non existing atom Closes #1532 See merge request pleroma/pleroma!2139
This commit is contained in:
commit
8533b63d1f
2 changed files with 1 additions and 22 deletions
|
@ -236,15 +236,7 @@ def from_binary_with_convert(binary) do
|
||||||
end
|
end
|
||||||
|
|
||||||
@spec from_string(String.t()) :: atom() | no_return()
|
@spec from_string(String.t()) :: atom() | no_return()
|
||||||
def from_string(":" <> entity), do: String.to_existing_atom(entity)
|
def from_string(string), do: do_transform_string(string)
|
||||||
|
|
||||||
def from_string(entity) when is_binary(entity) do
|
|
||||||
if is_module_name?(entity) do
|
|
||||||
String.to_existing_atom("Elixir.#{entity}")
|
|
||||||
else
|
|
||||||
entity
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
@spec convert(any()) :: any()
|
@spec convert(any()) :: any()
|
||||||
def convert(entity), do: do_convert(entity)
|
def convert(entity), do: do_convert(entity)
|
||||||
|
|
|
@ -105,17 +105,4 @@ test "transfer config values with full subkey update" do
|
||||||
Application.put_env(:pleroma, :assets, assets)
|
Application.put_env(:pleroma, :assets, assets)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
test "non existing atom" do
|
|
||||||
ConfigDB.create(%{
|
|
||||||
group: ":pleroma",
|
|
||||||
key: ":undefined_atom_key",
|
|
||||||
value: [live: 2, com: 3]
|
|
||||||
})
|
|
||||||
|
|
||||||
assert ExUnit.CaptureLog.capture_log(fn ->
|
|
||||||
TransferTask.start_link([])
|
|
||||||
end) =~
|
|
||||||
"updating env causes error, group: \":pleroma\" key: \":undefined_atom_key\" value: [live: 2, com: 3] error: %ArgumentError{message: \"argument error\"}"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue