Skip to content

Commit

Permalink
Fix Django 1.9 issue preventing use of MIDDLEWARE_CLASSES (#870)
Browse files Browse the repository at this point in the history
* Update CHANGELOG.md

* Fix Django 1.9 issue preventing use of MIDDLEWARE_CLASSES

Co-authored-by: Srikanth Chekuri <[email protected]>
  • Loading branch information
pezzer55 and srikanthccv authored Jan 21, 2022
1 parent 8bb1e74 commit 91d65e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `opentelemetry-instrumentation-asgi` ASGI: Conditionally create SERVER spans
([#843](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/843))

- `opentelemetry-instrumentation-django` Django: fix issue preventing detection of MIDDLEWARE_CLASSES

## [1.8.0-0.27b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.8.0-0.27b0) - 2021-12-17

Expand Down
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 91d65e0

Please sign in to comment.