Fish Trophy

david got a fish trophy!

Fish Trophy

Update to modern MIDDLEWARE setting.

Review Request #11911 — Created Jan. 7, 2022 and submitted

Information

Review Board
release-4.0.x

Reviewers

Django 1.10 introduced some changes to the way that middleware works.
Instead of having separate process_request and process_response
methods, middleware is now a callable which chains together. This
simplifies most cases to the point where most middleware can be
implemented as a nested function rather than a class. Opting into this
new behavior is done by changing the settings key from
MIDDLEWARE_CLASSES to MIDDLEWARE.

This change updates Review Board to use the new setting, and the
built-in middlewares to use the new pattern. As part of this, I needed
to upgrade django-cors-headers to a newer version. I've chosen the last
version that still supports Python 2.7.

  • Ran unit tests.
  • Smoke tested the Review Board UI.
Summary ID
Update to modern MIDDLEWARE setting.
Django 1.10 introduced some changes to the way that middleware works. Instead of having separate `process_request` and `process_response` methods, middleware is now a callable which chains together. This simplifies most cases to the point where most middleware can be implemented as a nested function rather than a class. Opting into this new behavior is done by changing the settings key from `MIDDLEWARE_CLASSES` to `MIDDLEWARE`. This change updates Review Board to use the new setting, and the built-in middlewares to use the new pattern. As part of this, I needed to upgrade django-cors-headers to a newer version. I've chosen the last version that still supports Python 2.7. Testing Done: - Ran unit tests. - Smoke tested the Review Board UI.
9d3c3a06d65092298f97980c4ba8b0d875232d25
Description From Last Updated

Seems the class should keep the bulk of the docstring in this case.

chipx86chipx86
chipx86
  1. 
      
  2. reviewboard/site/middleware.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
    Show all issues

    Seems the class should keep the bulk of the docstring in this case.

  3. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.0.x (e58b0ce)