Closed Timvde closed 6 years ago
This is a nice snippet but I'm not sure how generally applicable it is. If you wrote the decorator, why not put the if gargoyle.is_active
check inside the decorator itself?
The decorator is coming from a third party library, so we can't change it without forking the library itself. I'm also not sure useful this is in general, which is why I created an issue with the snippet instead of doing the whole forking/cleaning up code/writing tests dance to create a proper PR before I had confirmation that it'll be accepted.
Anyway, I'm fine with it if you don't deem it useful enough to upstream, at least it will get indexed by search engines for people to find :)
Thanks for more explanation. Yeah I think it's not general enough to merge, but this will let people find it if they need it. Cheers!
I have created this small snippet in our codebase:
Usage:
This will let you enable the switch to disable the decorator[1]. If this is something you want, I'm happy to look into gargoyle code and prepare a PR.
[1] This is a policy we're keeping so we don't have to toggle switches when releasing a new feature. It is of course easy to revert this, which I believe fits better in general gargoyle usage.