disqus / gargoyle

Feature switches in Django
http://engineering.disqus.com
Apache License 2.0
748 stars 112 forks source link

Allow conditions to apply to all, except blacklisted entries #53

Closed amandasaurus closed 10 years ago

amandasaurus commented 11 years ago

Currently, if you make a switch "selective" and then add a condition which excludes on thing (e.g. user/ip address) and add no other conditions, then one would assume that the switch will be active for all, except the user/ip address you explicitly blacklisted, and would be false for that user/ip address.

However this is not the case, instead the switch is not active for anyone.

This is from a bug in applying conditions. This patch fixes that.

amandasaurus commented 11 years ago

I have fixed & updated the failing test. The updated test shows what I believe should happen, if a switch has only one exclusion condition, then it should be active for all things that don't match that condition, and inactive for things that do match it.

This allows one to have "default on, but blacklist these condition" switches.

akaihola commented 11 years ago

This doesn't seem to make the "not Anonymous" condition work correctly. See my comment in https://github.com/disqus/gargoyle/issues/38#issuecomment-12587346

akaihola commented 11 years ago

Ignore my comment above, it works just fine. See the other comment in https://github.com/disqus/gargoyle/issues/38#issuecomment-12589480

robgolding commented 8 years ago

I know this is a really old PR and the project doesn't get much attention anymore, but I just wanted to come back to say that this introduces a really nasty bug (raised here https://github.com/disqus/gargoyle/issues/105).