fix for endpoints after env update
This commit is contained in:
parent
e412d2f152
commit
a71393dd29
2 changed files with 6 additions and 2 deletions
|
@ -74,7 +74,9 @@ def run(["migrate_from_db" | options]) do
|
||||||
defp load_and_create(group) do
|
defp load_and_create(group) do
|
||||||
group
|
group
|
||||||
|> Application.get_all_env()
|
|> Application.get_all_env()
|
||||||
|> Enum.reject(fn {k, _v} -> k in [Pleroma.Repo, :env] end)
|
|> Enum.reject(fn {k, _v} ->
|
||||||
|
k in [Pleroma.Repo, :env] or (group == :phoenix and k == :serve_endpoints)
|
||||||
|
end)
|
||||||
|> Enum.each(fn {key, value} ->
|
|> Enum.each(fn {key, value} ->
|
||||||
key = inspect(key)
|
key = inspect(key)
|
||||||
{:ok, _} = Config.update_or_create(%{group: inspect(group), key: key, value: value})
|
{:ok, _} = Config.update_or_create(%{group: inspect(group), key: key, value: value})
|
||||||
|
|
|
@ -37,7 +37,9 @@ defp update_env(setting) do
|
||||||
group = Config.from_string(setting.group)
|
group = Config.from_string(setting.group)
|
||||||
value = Config.from_binary(setting.value)
|
value = Config.from_binary(setting.value)
|
||||||
|
|
||||||
|
if group != :phoenix and key != :serve_endpoints do
|
||||||
:ok = Application.put_env(group, key, value)
|
:ok = Application.put_env(group, key, value)
|
||||||
|
end
|
||||||
|
|
||||||
group
|
group
|
||||||
rescue
|
rescue
|
||||||
|
|
Loading…
Reference in a new issue