You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 20, 2018. It is now read-only.
It's highly possible that I'm just using gargoyle wrong, but I'm experiencing surprising behavior.
In one of my project's apps, I've created a gargoyle.py file:
from __future__ importabsolute_importfromgargoyleimportgargoylegargoyle['foo'].add_condition(
condition_set='gargoyle.builtins.UserConditionSet(auth.user)',
field_name='percent',
condition='0-50'
)
My understanding is that this will make the foo switch active for 50% of users. This seems to work. The value in the database after I run my local server is:
Here it's checking if condition which is '0-50' is "in" a list of tuples, which will always return false. Obviously this is solvable by adding commit=False to Switch.add_condition. However, it makes me worry that I'm missing something fundamental.
The text was updated successfully, but these errors were encountered:
It's highly possible that I'm just using gargoyle wrong, but I'm experiencing surprising behavior.
In one of my project's apps, I've created a
gargoyle.py
file:My understanding is that this will make the
foo
switch active for 50% of users. This seems to work. The value in the database after I run my local server is:But now, if I restart my server, the condition is duplicated:
I've traced this to
Switch.add_condition
:Here it's checking if
condition
which is'0-50'
is "in" a list of tuples, which will always return false. Obviously this is solvable by addingcommit=False
toSwitch.add_condition
. However, it makes me worry that I'm missing something fundamental.The text was updated successfully, but these errors were encountered: