From 2d006b84deb469192e3c069730ea2b013a287554 Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Fri, 26 Jan 2024 12:36:35 -0500 Subject: [PATCH] MiddlewareMixin is always present in django>=3.2 it was added in django 2.0a1 --- csp/middleware.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/csp/middleware.py b/csp/middleware.py index 0e58024..c354b64 100644 --- a/csp/middleware.py +++ b/csp/middleware.py @@ -6,21 +6,9 @@ from functools import partial from django.conf import settings +from django.utils.deprecation import MiddlewareMixin from django.utils.functional import SimpleLazyObject -try: - from django.utils.deprecation import MiddlewareMixin -except ImportError: - - class MiddlewareMixin(object): - """ - If this middleware doesn't exist, this is an older version of django - and we don't need it. - """ - - pass - - from csp.utils import build_policy