Middleware fix for django >= 1.10 (#93)

Fixes the `TypeError: object.__init__() takes no parameters` that happens with the new MIDDLEWARE that is new in django 1.10
This commit is contained in:
Teemu N 2017-07-04 20:23:28 +03:00 committed by Ken Cochrane
parent 85817fd278
commit db7a9001db

View file

@ -1,10 +1,14 @@
try:
from django.utils.deprecation import MiddlewareMixin as MIDDLEWARE_BASE_CLASS
except ImportError:
MIDDLEWARE_BASE_CLASS = object
from django.contrib.auth import views as auth_views
from django.utils.decorators import method_decorator
from .decorators import watch_login
class FailedLoginMiddleware(object):
class FailedLoginMiddleware(MIDDLEWARE_BASE_CLASS):
""" Failed login middleware """
patched = False