fix for db key

This commit is contained in:
Alexander Strizhakov 2020-01-21 10:14:48 +03:00
commit dcae5914d1
No known key found for this signature in database
GPG key ID: 022896A53AEF1381
3 changed files with 23 additions and 2 deletions

View file

@ -205,9 +205,14 @@ defmodule Pleroma.ConfigDB do
{config, sub_keys} when is_list(sub_keys) <- {config, params[:subkeys]},
old_value <- from_binary(config.value),
keys <- Enum.map(sub_keys, &do_transform_string(&1)),
new_value <- Keyword.drop(old_value, keys) do
{:partial_remove, config, new_value} when new_value != [] <-
{:partial_remove, config, Keyword.drop(old_value, keys)} do
ConfigDB.update(config, %{value: new_value})
else
{:partial_remove, config, []} ->
Repo.delete(config)
{:ok, nil}
{config, nil} ->
Repo.delete(config)
{:ok, nil}

View file

@ -831,7 +831,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
Enum.map(values, fn {key, value} ->
db =
if configs[group][key] do
ConfigDB.get_db_keys(value, key)
ConfigDB.get_db_keys(configs[group][key], key)
end
db_value = configs[group][key]