- If any single exclude condition is a match, the flag is off (no matter what else)
- If any of the conditions match, the flag is on
- If any of the exclude conditions do not match, the flag is on
From a very careful read of:
def is_active(self, instance, conditions):
"""
Given an instance, and the conditions active for this switch, returns
a boolean representing if the feature is active.
"""
return_value = None
for name, field in self.fields.iteritems():
field_conditions = conditions.get(self.get_namespace(), {}).get(name)
if field_conditions:
value = self.get_field_value(instance, name)
for status, condition in field_conditions:
exclude = status == EXCLUDE
if field.is_active(condition, value):
if exclude:
return False
return_value = True
else:
if exclude:
return_value = True
return return_value