Remove unnecessary check fields in global_config() function

This commit is contained in:
Théophile Diot 2024-02-20 14:20:11 +01:00
parent da8a40d18b
commit 30a4155127
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06

View file

@ -820,12 +820,16 @@ def global_config():
# Edit check fields and remove already existing ones
config = app.config["CONFIG"].get_config(methods=False)
for variable, value in deepcopy(variables).items():
if variable.endswith("SCHEMA"):
del variables[variable]
continue
if value == "on":
value = "yes"
elif value == "off":
value = "no"
if value == config.get(variable, None) or not value.strip():
if value == config.get(variable, None):
del variables[variable]
if not variables: