Example #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()
Example #2
0
 def process_request(self, request):
     """Starts a new search context."""
     request.META[(WATSON_MIDDLEWARE_FLAG, self)] = True
     search_context_manager.start()
Example #3
0
 def process_request(self, request):
     """Starts a new search context."""
     request.META[(WATSON_MIDDLEWARE_FLAG, self)] = True
     search_context_manager.start()
Example #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()