Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed a raise condition when using the simple backend (e.g. in tests)…

… and changing the DEBUG setting dynamically (e.g. in integration tests).
  • Loading branch information...
commit 66f4157c0f676b421c202b0239a80800091c717c 1 parent 33e3217
@jezdez jezdez authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 haystack/backends/simple_backend.py
View
9 haystack/backends/simple_backend.py
@@ -24,19 +24,20 @@ def emit(self, record):
logger.setLevel(logging.WARNING)
logger.addHandler(NullHandler())
logger.addHandler(ch)
-
+else:
+ logger = None
class SimpleSearchBackend(BaseSearchBackend):
def update(self, indexer, iterable, commit=True):
- if settings.DEBUG:
+ if logger is not None:
logger.warning('update is not implemented in this backend')
def remove(self, obj, commit=True):
- if settings.DEBUG:
+ if logger is not None:
logger.warning('remove is not implemented in this backend')
def clear(self, models=[], commit=True):
- if settings.DEBUG:
+ if logger is not None:
logger.warning('clear is not implemented in this backend')
@log_query
Please sign in to comment.
Something went wrong with that request. Please try again.