summaryrefslogtreecommitdiffstats
path: root/askbot/startup_procedures.py
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-10-09 19:15:43 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-10-09 19:15:43 -0400
commitefe749c42b9998714600b7212cf5534bb5a4263b (patch)
tree0c2602d379690a519d83a8a154bda4bdbe8672d0 /askbot/startup_procedures.py
parentc1bc0f1330df63f04681a8d58b8cfec365f48a3c (diff)
downloadaskbot-efe749c42b9998714600b7212cf5534bb5a4263b.tar.gz
askbot-efe749c42b9998714600b7212cf5534bb5a4263b.tar.bz2
askbot-efe749c42b9998714600b7212cf5534bb5a4263b.zip
added url to the personal message notification, sidebar message counter to the inbox, updated test case for the PM email alert
Diffstat (limited to 'askbot/startup_procedures.py')
-rw-r--r--askbot/startup_procedures.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/askbot/startup_procedures.py b/askbot/startup_procedures.py
index 736397fb..acac0223 100644
--- a/askbot/startup_procedures.py
+++ b/askbot/startup_procedures.py
@@ -672,6 +672,37 @@ def test_longerusername():
errors.append('run "python manage.py migrate longerusername"')
print_errors(errors)
+def test_group_messaging():
+ """tests correctness of the "group_messaging" app configuration"""
+ errors = list()
+ if 'group_messaging' not in django_settings.INSTALLED_APPS:
+ errors.append("add to the INSTALLED_APPS:\n'group_messaging'")
+
+ settings_sample = ("GROUP_MESSAGING = {\n"
+ " 'base_url_getter_function': 'askbot.models.user_get_profile_url',\n"
+ " 'base_url_params': {'section': 'messages', 'sort': 'inbox'}\n"
+ "}")
+
+ settings = getattr(django_settings, 'GROUP_MESSAGING', {})
+ if settings:
+ url_params = settings.get('base_url_params', {})
+ have_wrong_params = not (
+ url_params.get('section', None) == 'messages' and \
+ url_params.get('sort', None) == 'inbox'
+ )
+ url_getter = settings.get('base_url_getter_function', None)
+ if url_getter != 'askbot.models.user_get_profile_url' or have_wrong_params:
+ errors.append(
+ "make setting 'GROUP_MESSAGING to be exactly:\n" + settings_sample
+ )
+
+ url_params = settings.get('base_url_params', None)
+ else:
+ errors.append('add this to your settings.py:\n' + settings_sample)
+
+ if errors:
+ print_errors(errors)
+
def run_startup_tests():
"""function that runs
all startup tests, mainly checking settings config so far
@@ -691,6 +722,7 @@ def run_startup_tests():
test_new_skins()
test_longerusername()
test_avatar()
+ test_group_messaging()
settings_tester = SettingsTester({
'CACHE_MIDDLEWARE_ANONYMOUS_ONLY': {
'value': True,