[fix] Raise an error if question has not been initialize

This commit is contained in:
ljf 2021-09-12 17:43:03 +02:00
parent 518d41f6a9
commit f8fed701b9

View file

@ -279,8 +279,11 @@ class ConfigPanel:
# Hydrating config panel with current value # Hydrating config panel with current value
logger.debug("Hydrating config with current values") logger.debug("Hydrating config with current values")
for _, _, option in self._iterate(): for _, _, option in self._iterate():
if option["name"] not in self.values: if option["id"] not in self.values:
continue if option["type"] in ["alert", "display_text", "markdown", "file"]:
continue
else:
raise YunohostError("config_missing_init_value", question=option["id"])
value = self.values[option["name"]] value = self.values[option["name"]]
# In general, the value is just a simple value. # In general, the value is just a simple value.
# Sometimes it could be a dict used to overwrite the option itself # Sometimes it could be a dict used to overwrite the option itself