Permalink
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...
1 parent a047f9b commit ca2d731bdb67c608df46ea7923a3e28c543d6f50 @jezdez jezdez committed with toastdriven Feb 22, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 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

0 comments on commit ca2d731

Please sign in to comment.