Skip to content

Commit

Permalink
Fixed middleware setting fallback in compatibility function. Take 2
Browse files Browse the repository at this point in the history
  • Loading branch information
czpython committed Sep 5, 2017
1 parent c36b795 commit 21d954e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cms/utils/compat/dj.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ def get_apps():


def get_middleware():
# order is important.
# django sets MIDDLEWARE to None which prevents MIDDLEWARE_CLASSES from being used.
return getattr(settings, 'MIDDLEWARE_CLASSES', getattr(settings, 'MIDDLEWARE'))
if getattr(settings, 'MIDDLEWARE', None) is None:
return settings.MIDDLEWARE_CLASSES
return settings.MIDDLEWARE

0 comments on commit 21d954e

Please sign in to comment.