diff --git a/kolibri/utils/options.py b/kolibri/utils/options.py index 8a3005e196c..b990691955d 100644 --- a/kolibri/utils/options.py +++ b/kolibri/utils/options.py @@ -992,6 +992,12 @@ def generate_empty_options_file(ini_filename="options.ini"): conf = read_options_file(ini_filename=ini_filename) + for section, opts in option_spec.items(): + for optname, attrs in opts.items(): + for envvar in attrs.get("envvars", []): + if envvar in os.environ: + conf[section].pop(optname, None) + comments = None for section, opts in option_spec.items():