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
A few of our flag_is_active checks are passing in "None" for the underlying HttpRequest object. This is because the request isn't accessible in the context that it is being used in.
However, doing so breaks some functionality. All instances of these should be refactored such that we are now passing in a HttpRequest object
Acceptance criteria
All checks using flag_is_active for "disable_email_sending" pass in a request object
Double check that all of our checks for "organization_feature" pass in a request object
Double check that all of our checks for "multiple_portfolios" pass in a request object
Additional context
One approach to this may be to create a bogus request and pass it to the user context. However, this would need to be tested thoroughly.
An alternative would be to write a custom function in WaffleFlags that essentially does what flag_is_active does, but it takes the user and the flag name rather than the request and the flag name.
If you decide to go this route, remember to also refactor the other bogus requests created for our organization_feature flag
abroddrick
changed the title
Refactor waffle flags "profile_feature" and "disable_email_sending" to include a request object
Refactor and ensure all waffle flags to include a request object
Aug 29, 2024
Issue description
A few of our
flag_is_active
checks are passing in "None" for the underlying HttpRequest object. This is because the request isn't accessible in the context that it is being used in.However, doing so breaks some functionality. All instances of these should be refactored such that we are now passing in a HttpRequest object
Acceptance criteria
flag_is_active
for "disable_email_sending" pass in a request objectAdditional context
One approach to this may be to create a bogus request and pass it to the user context. However, this would need to be tested thoroughly.
An alternative would be to write a custom function in WaffleFlags that essentially does what
flag_is_active
does, but it takes the user and the flag name rather than the request and the flag name.If you decide to go this route, remember to also refactor the other bogus requests created for our organization_feature flag
Links to other issues
The text was updated successfully, but these errors were encountered: