Skip to content

Commit 7880add

Browse files
pezzer55srikanthccv
authored andcommitted
Fix Django 1.9 issue preventing use of MIDDLEWARE_CLASSES (open-telemetry#870)
* Update CHANGELOG.md * Fix Django 1.9 issue preventing use of MIDDLEWARE_CLASSES Co-authored-by: Srikanth Chekuri <[email protected]>
1 parent a107960 commit 7880add

File tree

2 files changed

+2
-1
lines changed
  • instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django

2 files changed

+2
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2828
- `opentelemetry-instrumentation-asgi` ASGI: Conditionally create SERVER spans
2929
([#843](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/843))
3030

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

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

instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def _get_django_middleware_setting() -> str:
105105
# In Django versions 1.x, setting MIDDLEWARE_CLASSES can be used as a legacy
106106
# alternative to MIDDLEWARE. This is the case when `settings.MIDDLEWARE` has
107107
# its default value (`None`).
108-
if not DJANGO_2_0 and getattr(settings, "MIDDLEWARE", []) is None:
108+
if not DJANGO_2_0 and getattr(settings, "MIDDLEWARE", None) is None:
109109
return "MIDDLEWARE_CLASSES"
110110
return "MIDDLEWARE"
111111

0 commit comments

Comments
 (0)