-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e3a226
commit 5475f07
Showing
2 changed files
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
from django.http import HttpRequest | ||
from waffle.decorators import flag_is_active | ||
|
||
|
||
def flag_is_active_for_user(user, flag_name): | ||
"""flag_is_active_for_user can be used when a waffle_flag may be | ||
activated for a user, but the context of where the flag needs to | ||
be tested does not have a request object available. | ||
When the request is available, flag_is_active should be used.""" | ||
request = HttpRequest() | ||
request.user = user | ||
return flag_is_active(request, flag_name) | ||
return flag_is_active(request, flag_name) |