Description: Fix middleware to be compatible with Django 1.10
Origin: upstream, https://patch-diff.githubusercontent.com/raw/kstateome/django-cas/pull/64.diff
Last-Update: 2019-04-11
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/cas/middleware.py
+++ b/cas/middleware.py
@@ -5,6 +5,15 @@ try:
 except ImportError:
     from urllib.parse import urlencode
 
+
+MIDDLEWARE_BASE = None
+
+try:
+    from django.utils.deprecation import MiddlewareMixin
+    MIDDLEWARE_BASE = MiddlewareMixin
+except ImportError:
+    MIDDLEWARE_BASE = object
+
 from django.conf import settings
 from django.contrib.auth import REDIRECT_FIELD_NAME
 from django.contrib.auth import logout as do_logout
@@ -19,7 +28,7 @@ from cas.views import login as cas_login
 __all__ = ['CASMiddleware']
 
 
-class CASMiddleware(object):
+class CASMiddleware(MIDDLEWARE_BASE):
     """
     Middleware that allows CAS authentication on admin pages
     """
@@ -81,7 +90,7 @@ class CASMiddleware(object):
             return None
 
 
-class ProxyMiddleware(object):
+class ProxyMiddleware(MIDDLEWARE_BASE):
 
     # Middleware used to "fake" the django app that it lives at the Proxy Domain
     def process_request(self, request):
