mirror of
https://github.com/Hopiu/django-watson.git
synced 2026-03-16 22:00:22 +00:00
Merge pull request #195 from blodone/master
fix middleware object, use MiddlewareMixin if present for Django 1.10
This commit is contained in:
commit
cb3d12c137
1 changed files with 6 additions and 1 deletions
|
|
@ -3,6 +3,11 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
try:
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
cls = MiddlewareMixin
|
||||
except:
|
||||
cls = object
|
||||
|
||||
from watson.search import search_context_manager
|
||||
|
||||
|
|
@ -10,7 +15,7 @@ from watson.search import search_context_manager
|
|||
WATSON_MIDDLEWARE_FLAG = "watson.search_context_middleware_active"
|
||||
|
||||
|
||||
class SearchContextMiddleware(object):
|
||||
class SearchContextMiddleware(cls):
|
||||
|
||||
"""Wraps the entire request in a search context."""
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue