[Python-modules-commits] [django-cors-headers] 01/03: Fix Django 1.0 support

Brian May bam at moszumanska.debian.org
Fri Feb 10 09:18:38 UTC 2017


This is an automated email from the git hooks/post-receive script.

bam pushed a commit to branch master
in repository django-cors-headers.

commit 09adb1de0a7b0d99121d135e0a0019f11145fb31
Author: Brian May <bam at debian.org>
Date:   Fri Feb 10 17:14:03 2017 +1100

    Fix Django 1.0 support
    
    Patch downloaded from upstream
    https://github.com/ottoyiu/django-cors-headers/commit/870b1d9deb54ff4c1fefedc39dff02519abb32c5
---
 corsheaders/middleware.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/corsheaders/middleware.py b/corsheaders/middleware.py
index f22ee58..c6c1af8 100755
--- a/corsheaders/middleware.py
+++ b/corsheaders/middleware.py
@@ -12,6 +12,11 @@ try:
 except ImportError:
     from django.db.models.loading import get_model
 
+try:
+    from django.utils.deprecation import MiddlewareMixin
+except ImportError:
+    MiddlewareMixin = object
+
 from corsheaders import defaults as settings
 
 
@@ -23,7 +28,7 @@ ACCESS_CONTROL_ALLOW_METHODS = 'Access-Control-Allow-Methods'
 ACCESS_CONTROL_MAX_AGE = 'Access-Control-Max-Age'
 
 
-class CorsPostCsrfMiddleware(object):
+class CorsPostCsrfMiddleware(MiddlewareMixin):
 
     def _https_referer_replace_reverse(self, request):
         """
@@ -45,7 +50,7 @@ class CorsPostCsrfMiddleware(object):
         return None
 
 
-class CorsMiddleware(object):
+class CorsMiddleware(MiddlewareMixin):
 
     def _https_referer_replace(self, request):
         """

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/django-cors-headers.git



More information about the Python-modules-commits mailing list