summaryrefslogtreecommitdiffstats
path: root/askbot/startup_procedures.py
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-10-12 01:27:11 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-10-12 01:27:11 -0400
commitcb358e33d98ab7d73165ed03428fc0e4cedec828 (patch)
tree5fd0ffa896775a77c8484576b8ec217704649329 /askbot/startup_procedures.py
parentffcc088eeccfcfb534fa2854ce9ea8df36f6d12c (diff)
downloadaskbot-cb358e33d98ab7d73165ed03428fc0e4cedec828.tar.gz
askbot-cb358e33d98ab7d73165ed03428fc0e4cedec828.tar.bz2
askbot-cb358e33d98ab7d73165ed03428fc0e4cedec828.zip
merged the haystack support branch
Diffstat (limited to 'askbot/startup_procedures.py')
-rw-r--r--askbot/startup_procedures.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/askbot/startup_procedures.py b/askbot/startup_procedures.py
index 0a9e4e07..706e19ad 100644
--- a/askbot/startup_procedures.py
+++ b/askbot/startup_procedures.py
@@ -534,12 +534,16 @@ def test_avatar():
def test_haystack():
if 'haystack' in django_settings.INSTALLED_APPS:
try_import('haystack', 'django-haystack', short_message = True)
- if not hasattr(django_settings, 'HAYSTACK_SEARCH_ENGINE'):
- message = 'Please add HAYSTACK_SEARCH_ENGINE = simple, for more info please checkout: http://django-haystack.readthedocs.org/en/v1.2.7/settings.html#haystack-search-engine'
- raise AskbotConfigError(message)
- if not hasattr(django_settings, 'HAYSTACK_SITECONF'):
- message = 'Please add HAYSTACK_SITECONF = "askbot.search.haystack"'
- raise AskbotConfigError(message)
+ if getattr(django_settings, 'ENABLE_HAYSTACK_SEARCH', False):
+ errors = list()
+ if not hasattr(django_settings, 'HAYSTACK_SEARCH_ENGINE'):
+ message = "Please HAYSTACK_SEARCH_ENGINE to an appropriate value, value 'simple' can be used for basic testing"
+ errors.append(message)
+ if not hasattr(django_settings, 'HAYSTACK_SITECONF'):
+ message = 'Please add HAYSTACK_SITECONF = "askbot.search.haystack"'
+ errors.append(message)
+ footer = 'Please refer to haystack documentation at http://django-haystack.readthedocs.org/en/v1.2.7/settings.html#haystack-search-engine'
+ print_errors(errors, footer=footer)
def test_custom_user_profile_tab():
setting_name = 'ASKBOT_CUSTOM_USER_PROFILE_TAB'
@@ -732,9 +736,6 @@ def run_startup_tests():
'value': True,
'message': 'Please add: RECAPTCHA_USE_SSL = True'
},
- 'ENABLE_HAYSTACK_SEARCH': {
- 'message': 'Please add: ENABLE_HAYSTACK_SEARCH = False or True according to your setup'
- },
'HAYSTACK_SITECONF': {
'value': 'askbot.search.haystack',
'message': 'Please add: HAYSTACK_SITECONF = "askbot.search.haystack"'