Skip to content

Commit

Permalink
Merge branch 'master' into fix-flush-with-reverse-m2m-changed-signal
Browse files Browse the repository at this point in the history
  • Loading branch information
k4rl85 authored Jan 18, 2021
2 parents 917f573 + 03d9783 commit 598992a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions waffle/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def is_active(self, request):
}
)
cache = get_cache()
cache.add(self._cache_key(self.name), flag)
cache.set(self._cache_key(self.name), flag)

return get_setting('FLAG_DEFAULT')

Expand Down Expand Up @@ -453,7 +453,7 @@ def is_active(self):
}
)
cache = get_cache()
cache.add(self._cache_key(self.name), switch)
cache.set(self._cache_key(self.name), switch)

return get_setting('SWITCH_DEFAULT')

Expand Down Expand Up @@ -523,7 +523,7 @@ def is_active(self):
}
)
cache = get_cache()
cache.add(self._cache_key(self.name), sample)
cache.set(self._cache_key(self.name), sample)

return get_setting('SAMPLE_DEFAULT')
return Decimal(str(random.uniform(0, 100))) <= self.percent

0 comments on commit 598992a

Please sign in to comment.