Closed jmduke closed 5 years ago
Here's an example before and after of the change. In the context processor for this view, I'm grabbing a list of views with Flag.get_all()
and iterating over them. Think something like:
{flag.name: flag.is_active_for_user(obj.user) for flag in Flag.get_all()}
Before:
After:
Howdy! Thanks for a great package. I have a small change for improving
is_active_for_user
query performance when checking flag enrollment for a flag without groups; namely, skipping the user.groups call (which generally results in a DB call.)This should be a no-op;
set().intersection(<anything>) == set()
, so this should just be a easy little way to short-circuit.