summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-06-19 10:10:58 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-06-19 10:10:58 -0400
commit2cace904d71cc37b66e99a0745815df5cd17fe17 (patch)
treef5182112e1d0283cd5ef97dd5d8544eb57fb6832
parent5c32fa37bb709d1cb71ed0158ea6266a12ebff80 (diff)
downloadaskbot-2cace904d71cc37b66e99a0745815df5cd17fe17.tar.gz
askbot-2cace904d71cc37b66e99a0745815df5cd17fe17.tar.bz2
askbot-2cace904d71cc37b66e99a0745815df5cd17fe17.zip
two more bug fixes
-rw-r--r--askbot/models/question.py14
-rw-r--r--askbot/views/readers.py1
2 files changed, 8 insertions, 7 deletions
diff --git a/askbot/models/question.py b/askbot/models/question.py
index 2e8faa06..4b3318b3 100644
--- a/askbot/models/question.py
+++ b/askbot/models/question.py
@@ -191,7 +191,12 @@ class ThreadManager(BaseQuerySetManager):
if askbot_settings.ENABLE_CONTENT_MODERATION:
qs = qs.filter(approved = True)
- meta_data = {}
+ #if groups feature is enabled, filter out threads
+ #that are private in groups to which current user does not belong
+ if askbot_settings.GROUPS_ENABLED:
+ #get group names
+ qs = self.exclude_group_private(user = request_user)
+
#run text search while excluding any modifier in the search string
#like #tag [title: something] @user
@@ -202,12 +207,6 @@ class ThreadManager(BaseQuerySetManager):
#FTS may break the chain of the query set calls,
#since it might go into an external asset, like Solr
- #if groups feature is enabled, filter out threads
- #that are private in groups to which current user does not belong
- if askbot_settings.GROUPS_ENABLED:
- #get group names
- qs = self.exclude_group_private(user = request_user)
-
#search in titles, if necessary
if search_state.query_title:
qs = qs.filter(title__icontains = search_state.query_title)
@@ -226,6 +225,7 @@ class ThreadManager(BaseQuerySetManager):
#plus any tags added to the query string with #tag or [tag:something]
#syntax.
#run tag search in addition to these unified tags
+ meta_data = {}
tags = search_state.unified_tags()
if len(tags) > 0:
diff --git a/askbot/views/readers.py b/askbot/views/readers.py
index 7782c7e6..f0460b20 100644
--- a/askbot/views/readers.py
+++ b/askbot/views/readers.py
@@ -164,6 +164,7 @@ def questions(request, **kwargs):
'threads': page,
'search_state': search_state,
'reset_method_count': reset_method_count,
+ 'request': request
}))
ajax_data = {