app_config_get: do not raise error if no config panel found on API

This commit is contained in:
axolotle 2022-11-26 12:46:11 +01:00
parent 2d3546247a
commit f096a14189

View file

@ -1666,8 +1666,15 @@ def app_config_get(app, key="", full=False, export=False):
else:
mode = "classic"
try:
config_ = AppConfigPanel(app)
return config_.get(key, mode)
except YunohostValidationError as e:
if Moulinette.interface.type == 'api' and e.key == "config_no_panel":
# Be more permissive when no config panel found
return {}
else:
raise
@is_unit_operation()