mirror of
https://github.com/jazzband/django-defender.git
synced 2026-03-16 22:10:32 +00:00
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:
parent
85817fd278
commit
db7a9001db
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue