Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise MiddlewareNotUsed in deprecated FlagConditionsMiddleware #66

Merged
merged 1 commit into from Jun 10, 2020

Conversation

willbarton
Copy link
Member

Per the Django documentation on marking middle as unused, this change raises MiddlewareNotUsed when initializing the deprecated FlagConditionsMiddleware. This way, Django takes the middleware out of the middleware process and the fact that this middleware no longer calls get_response and returns it for a request will not interrupt the flow of the request through other middleware or to the user.

This allows us to get rid of the __call__ noop.

Per the [Django documentation](https://docs.djangoproject.com/en/2.2/topics/http/middleware/#marking-middleware-as-unused) on marking middle as unused, this change raises `MiddlewareNotUsed` when initializing the deprecated `FlagConditionsMiddleware`. This way, Django takes the middleware out of the middleware process and the fact that this middleware no longer calls `get_response` and returns it for a request will not interrupt the flow of the request through other middleware or to the user.

This allows us to get rid of the `__call__` noop.
@willbarton willbarton requested review from chosak and a team June 2, 2020 13:36
@willbarton willbarton added this to 5.0 in Roadmap Jun 3, 2020
@willbarton willbarton merged commit 77f31a8 into master Jun 10, 2020
@willbarton willbarton deleted the fix-flag-middleware-noop branch June 10, 2020 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant