It's because in Jinja2, string vars are "truthy" when used in bool expressions, meaning any raw (ie no "bool()" filter applied) non-null value evaluates to "true".