Skip to content

Commit

Permalink
Fix Django 1.9 issue preventing use of MIDDLEWARE_CLASSES
Browse files Browse the repository at this point in the history
  • Loading branch information
pezzer55 authored Jan 20, 2022
1 parent cc62375 commit c302e2e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def _get_django_middleware_setting() -> str:
# In Django versions 1.x, setting MIDDLEWARE_CLASSES can be used as a legacy
# alternative to MIDDLEWARE. This is the case when `settings.MIDDLEWARE` has
# its default value (`None`).
if not DJANGO_2_0 and getattr(settings, "MIDDLEWARE", []) is None:
if not DJANGO_2_0 and getattr(settings, "MIDDLEWARE", None) is None:
return "MIDDLEWARE_CLASSES"
return "MIDDLEWARE"

Expand Down

0 comments on commit c302e2e

Please sign in to comment.