Code cleanup in django.core.handlers.base.BaseHandler
|Reported by:||Aymeric Augustin||Owned by:||nobody|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
__init__ sets all middleware lists to
load_middleware creates and populates them.
There is a small inconsistency that probably dates back to the introduction of template response middleware:
self._template_response_middleware isn't initialized, while the other lists are. I don't know if it creates a bug — at first sight, this initialization could be skipped entirely — but I believe it should be fixed for the shake of consistency.
load_middleware's docstring refers to a
__call__ method that doesn't exist in the class; I improved that comment.
Attached patch fixes this.