summaryrefslogtreecommitdiffstats
path: root/askbot/startup_procedures.py
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-10-16 02:19:49 -0300
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-10-16 02:19:49 -0300
commitd91cae28c867557bc660b6a8898229e52c5487d5 (patch)
tree8e4281cccd404f74cda1ccdcca6a18b04fa8db38 /askbot/startup_procedures.py
parent10aa8cb45fa01cd7d809cca70895092bc9a485ee (diff)
parent8206b2955fc0953afe9f7f7b6834a9e132f5d497 (diff)
downloadaskbot-d91cae28c867557bc660b6a8898229e52c5487d5.tar.gz
askbot-d91cae28c867557bc660b6a8898229e52c5487d5.tar.bz2
askbot-d91cae28c867557bc660b6a8898229e52c5487d5.zip
merged the master branch and fixed issues when you visit a thread by url and then try to create a new thread or visit other threads lists
Diffstat (limited to 'askbot/startup_procedures.py')
-rw-r--r--askbot/startup_procedures.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/askbot/startup_procedures.py b/askbot/startup_procedures.py
index acac0223..6b28f688 100644
--- a/askbot/startup_procedures.py
+++ b/askbot/startup_procedures.py
@@ -531,13 +531,27 @@ 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 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'
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)
@@ -723,6 +737,7 @@ def run_startup_tests():
test_longerusername()
test_avatar()
test_group_messaging()
+ test_haystack()
settings_tester = SettingsTester({
'CACHE_MIDDLEWARE_ANONYMOUS_ONLY': {
'value': True,
@@ -752,6 +767,10 @@ def run_startup_tests():
'RECAPTCHA_USE_SSL': {
'value': True,
'message': 'Please add: RECAPTCHA_USE_SSL = True'
+ },
+ 'HAYSTACK_SITECONF': {
+ 'value': 'askbot.search.haystack',
+ 'message': 'Please add: HAYSTACK_SITECONF = "askbot.search.haystack"'
}
})
settings_tester.run()