Fix code to follow Code Climate suggestions
@@ -143,9 +143,7 @@ def render_variable(env, raw, cookiecutter_dict):
being populated with variables.
:return: The rendered value for the default variable.
"""
- if raw is None:
- return None
- elif isinstance(raw, bool):
+ if raw is None or isinstance(raw, bool):
return raw
elif isinstance(raw, dict):
return {
@@ -205,10 +203,12 @@ def prompt_for_config(context, no_input=False):
cookiecutter_dict[key] = val
elif isinstance(raw, bool):
# We are dealing with a boolean variable
- val = render_variable(env, raw, cookiecutter_dict)
- if not no_input:
- val = read_user_yes_no(key, raw)
- cookiecutter_dict[key] = val
+ if no_input:
+ cookiecutter_dict[key] = render_variable(
+ env, raw, cookiecutter_dict
+ )
+ else:
+ cookiecutter_dict[key] = read_user_yes_no(key, raw)
elif not isinstance(raw, dict):
# We are dealing with a regular variable
val = render_variable(env, raw, cookiecutter_dict)
