mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-13 17:53:12 +00:00
Fixed crash when tests are run without WAGTAILSEARCH_BACKENDS setting set
This commit is contained in:
parent
03e70df24f
commit
fd95cc0517
1 changed files with 5 additions and 2 deletions
|
|
@ -17,8 +17,11 @@ from wagtail.wagtailsearch.backends.elasticsearch import ElasticSearch
|
|||
|
||||
|
||||
def find_backend(cls):
|
||||
if not hasattr(settings, 'WAGTAILSEARCH_BACKENDS') and cls == DBSearch:
|
||||
return 'default'
|
||||
if not hasattr(settings, 'WAGTAILSEARCH_BACKENDS'):
|
||||
if cls == DBSearch:
|
||||
return 'default'
|
||||
else:
|
||||
return
|
||||
|
||||
for backend in settings.WAGTAILSEARCH_BACKENDS.keys():
|
||||
if isinstance(get_search_backend(backend), cls):
|
||||
|
|
|
|||
Loading…
Reference in a new issue