From 2cace904d71cc37b66e99a0745815df5cd17fe17 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Tue, 19 Jun 2012 10:10:58 -0400 Subject: two more bug fixes --- askbot/models/question.py | 14 +++++++------- askbot/views/readers.py | 1 + 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 = { -- cgit v1.2.3-1-g7c22