[4] fix square flags

pull/1282/head
meisnate12 2 years ago
parent 563d2d9a9f
commit 32764cf136

@ -1 +1 @@
1.18.3-develop3 1.18.3-develop4

@ -328,10 +328,12 @@ class DataFile:
var_default = {replace_var(dk, variables): replace_var(dv, variables) for dk, dv in all_init_defaults.items() if dk not in variables} var_default = {replace_var(dk, variables): replace_var(dv, variables) for dk, dv in all_init_defaults.items() if dk not in variables}
for dkey, dvalue in var_default.items(): for dkey, dvalue in var_default.items():
final_key = replace_var(dkey, var_default) final_key = replace_var(dkey, var_default)
final_value = replace_var(dvalue, var_default)
if final_key not in optional and final_key not in variables and final_key not in conditionals: if final_key not in optional and final_key not in variables and final_key not in conditionals:
default[final_key] = final_value default[final_key] = dvalue
default[f"{final_key}_encoded"] = requests.utils.quote(str(final_value)) if "<<" in str(dvalue):
default[f"{final_key}_encoded"] = re.sub(r'<<(.+)>>', r'<<\1_encoded>>', dvalue)
else:
default[f"{final_key}_encoded"] = requests.utils.quote(str(dvalue))
if "optional" in template: if "optional" in template:
if template["optional"]: if template["optional"]:
@ -411,8 +413,11 @@ class DataFile:
if condition_passed: if condition_passed:
logger.debug(f'Conditional Variable: {final_key} is "{condition["value"]}"') logger.debug(f'Conditional Variable: {final_key} is "{condition["value"]}"')
condition_found = True condition_found = True
variables[final_key] = condition["value"] if condition["value"] is not None:
variables[f"{final_key}_encoded"] = requests.utils.quote(str(condition["value"])) variables[final_key] = condition["value"]
variables[f"{final_key}_encoded"] = requests.utils.quote(str(condition["value"]))
else:
optional.append(final_key)
break break
if not condition_found: if not condition_found:
if "default" in con_value: if "default" in con_value:

Loading…
Cancel
Save