summaryrefslogtreecommitdiffstats
path: root/askbot/startup_procedures.py
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-10-11 20:45:00 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-10-11 20:45:00 -0400
commitffcc088eeccfcfb534fa2854ce9ea8df36f6d12c (patch)
tree50111a9d9faffb9340b23b9884052936130b9c77 /askbot/startup_procedures.py
parent18de3b9d5d8fadff635867d1b3cd635c23ff0b51 (diff)
parent777b21410ad3e4ab87169210f646b2c75693d738 (diff)
downloadaskbot-ffcc088eeccfcfb534fa2854ce9ea8df36f6d12c.tar.gz
askbot-ffcc088eeccfcfb534fa2854ce9ea8df36f6d12c.tar.bz2
askbot-ffcc088eeccfcfb534fa2854ce9ea8df36f6d12c.zip
Merge branch 'haystack'
Diffstat (limited to 'askbot/startup_procedures.py')
-rw-r--r--askbot/startup_procedures.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/askbot/startup_procedures.py b/askbot/startup_procedures.py
index 736397fb..0a9e4e07 100644
--- a/askbot/startup_procedures.py
+++ b/askbot/startup_procedures.py
@@ -531,13 +531,23 @@ def test_avatar():
short_message = True
)
+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)
+
def test_custom_user_profile_tab():
setting_name = 'ASKBOT_CUSTOM_USER_PROFILE_TAB'
tab_settings = getattr(django_settings, setting_name, None)
if tab_settings:
if not isinstance(tab_settings, dict):
print "Setting %s must be a dictionary!!!" % setting_name
-
+
name = tab_settings.get('NAME', None)
slug = tab_settings.get('SLUG', None)
func_name = tab_settings.get('CONTENT_GENERATOR', None)
@@ -691,6 +701,7 @@ def run_startup_tests():
test_new_skins()
test_longerusername()
test_avatar()
+ test_haystack()
settings_tester = SettingsTester({
'CACHE_MIDDLEWARE_ANONYMOUS_ONLY': {
'value': True,
@@ -720,6 +731,13 @@ def run_startup_tests():
'RECAPTCHA_USE_SSL': {
'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"'
}
})
settings_tester.run()