cfpb / django-flags

Feature flags for Django projects
https://cfpb.github.io/django-flags/
Creative Commons Zero v1.0 Universal
260 stars 32 forks source link

Move optional/required condition filtering back to check_state() #47

Closed willbarton closed 5 years ago

willbarton commented 5 years ago

755a11290c70f7048f479525a5593d3554cc0ae7 did some refactoring of when optional and required conditions are filtered. This has resulted in some issues where conditions aren't being correctly evaluated.

Thanks to @chosak, the issue is conditions is modified on the Flag object after __init__ is called, but optional_conditions and required_conditions are never updated after __init__.

This seems like it was a false optimization. This PR reverts it to fix the issue.

chosak commented 5 years ago

While Travis is bogged down, it sure would be nice to have a test that tests this specific problem. 🐴

willbarton commented 5 years ago

Forgot to push this yesterday — test added in bb82064.