summaryrefslogtreecommitdiffstats
path: root/askbot/search
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-03-22 00:10:30 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-03-22 00:10:30 -0400
commitdf2a120b28c74e3e85819294d0652759f6194af9 (patch)
treed8f962aecdb1e81f796695e6232183bb3f1f0e43 /askbot/search
parentdb7fdd122616d527f62747738c4225b03a69ab09 (diff)
downloadaskbot-df2a120b28c74e3e85819294d0652759f6194af9.tar.gz
askbot-df2a120b28c74e3e85819294d0652759f6194af9.tar.bz2
askbot-df2a120b28c74e3e85819294d0652759f6194af9.zip
allowed to enable and disable scopes on the main page
Diffstat (limited to 'askbot/search')
-rw-r--r--askbot/search/state_manager.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/askbot/search/state_manager.py b/askbot/search/state_manager.py
index 7b6b746c..efefbc40 100644
--- a/askbot/search/state_manager.py
+++ b/askbot/search/state_manager.py
@@ -9,6 +9,7 @@ from django.utils.encoding import smart_str
import askbot
import askbot.conf
+from askbot.conf import settings as askbot_settings
from askbot import const
from askbot.utils.functions import strip_plus
@@ -90,8 +91,11 @@ class SearchState(object):
def __init__(self, scope, sort, query, tags, author, page, user_logged_in):
# INFO: zip(*[('a', 1), ('b', 2)])[0] == ('a', 'b')
- if (scope not in zip(*const.POST_SCOPE_LIST)[0]) or (scope == 'favorite' and not user_logged_in):
- self.scope = const.DEFAULT_POST_SCOPE
+ if (scope not in zip(*const.POST_SCOPE_LIST)[0]) or (scope == 'followed' and not user_logged_in):
+ if user_logged_in:
+ self.scope = askbot_settings.DEFAULT_SCOPE_AUTHENTICATED
+ else:
+ self.scope = askbot_settings.DEFAULT_SCOPE_ANONYMOUS
else:
self.scope = scope