Commit d996f408 authored by derek-knox's avatar derek-knox
Browse files

use Micaeël's recommended approach for defaulting config settings vs manual re-iteration

parent a75a5eeb
......@@ -83,16 +83,9 @@ def get_plugin_configuration() -> Response:
settings = PluginSettingsService(db.session, project)
config = flatten(
settings.as_config(plugin, sources=[PluginSettingValueSource.DB]), reducer="dot"
settings.as_config(plugin), reducer="dot"
)
# Apply default config
for setting in settings.get_definition(plugin).settings:
key = setting["name"]
if not key in config:
if "value" in setting:
config[key] = setting["value"]
return jsonify(
{
# freeze the keys because they are used for lookups
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment