added ability to use pure boolean in conditionals

This commit is contained in:
Brian Coca 2016-09-02 08:53:50 -04:00
parent 513297abf9
commit 4457985062

View file

@ -64,6 +64,10 @@ class Conditional:
ds = getattr(self, '_ds') ds = getattr(self, '_ds')
try: try:
# this allows for direct boolean assignments to conditionals "when: False"
if isinstance(self.when, bool):
return self.when
for conditional in self.when: for conditional in self.when:
if not self._check_conditional(conditional, templar, all_vars): if not self._check_conditional(conditional, templar, all_vars):
return False return False