示例#1
0
 def process_request(self, request):
     """Starts a new search context."""
     if request.META.get(WATSON_MIDDLEWARE_FLAG, False):
         raise ImproperlyConfigured(
             "SearchContextMiddleware can only be included in MIDDLEWARE_CLASSES once."
         )
     request.META[WATSON_MIDDLEWARE_FLAG] = True
     search_context_manager.start()
示例#2
0
 def process_request(self, request):
     """Starts a new search context."""
     request.META[(WATSON_MIDDLEWARE_FLAG, self)] = True
     search_context_manager.start()
示例#3
0
 def process_request(self, request):
     """Starts a new search context."""
     request.META[(WATSON_MIDDLEWARE_FLAG, self)] = True
     search_context_manager.start()
示例#4
0
 def process_request(self, request):
     """Starts a new search context."""
     if request.META.get(WATSON_MIDDLEWARE_FLAG, False):
         raise ImproperlyConfigured("SearchContextMiddleware can only be included in MIDDLEWARE_CLASSES once.")
     request.META[WATSON_MIDDLEWARE_FLAG] = True
     search_context_manager.start()