diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-08-03 22:17:08 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-08-03 22:17:08 -0400 |
commit | ca2bf1f30f3c081abd518e541362f91ebdb968ad (patch) | |
tree | 536301d3aa6bc90eea5f27248a863613f9b8e98f | |
parent | fa8bae9a208914465f7c099ad6bfbe1a3d0c9ca8 (diff) | |
parent | 061c50ee78e7a74f700a9c7c97fad57be17c4954 (diff) | |
download | askbot-ca2bf1f30f3c081abd518e541362f91ebdb968ad.tar.gz askbot-ca2bf1f30f3c081abd518e541362f91ebdb968ad.tar.bz2 askbot-ca2bf1f30f3c081abd518e541362f91ebdb968ad.zip |
Merge branch 'github'
-rw-r--r-- | askbot/deployment/__init__.py | 2 | ||||
-rw-r--r-- | askbot/search/haystack/__init__.py | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/askbot/deployment/__init__.py b/askbot/deployment/__init__.py index 5477b284..0dbe58c6 100644 --- a/askbot/deployment/__init__.py +++ b/askbot/deployment/__init__.py @@ -152,7 +152,7 @@ def deploy_askbot(options): create_new_project = False if os.path.exists(options['dir_name']): if path_utils.has_existing_django_project(options['dir_name']): - create_new_project = bool(options.force) + create_new_project = bool(options['force']) else: create_new_project = True else: diff --git a/askbot/search/haystack/__init__.py b/askbot/search/haystack/__init__.py index 9b99ef28..481f2d72 100644 --- a/askbot/search/haystack/__init__.py +++ b/askbot/search/haystack/__init__.py @@ -34,17 +34,21 @@ class PostIndex(indexes.SearchIndex, indexes.Indexable): author = indexes.CharField() thread_id = indexes.IntegerField(model_attr='thread__pk') + def get_model(self): from askbot.models import Post return Post def index_queryset(self, using=None): + ALLOWED_TYPES = ('question', 'answer', 'comment') if getattr(settings, 'ASKBOT_MULTILINGUAL', True): lang_code = get_language()[:2] return self.get_model().objects.filter(language_code__startswith=lang_code, - deleted=False) + deleted=False, + post_type__in=ALLOWED_TYPES) else: - return self.get_model().objects.filter(deleted=False) + return self.get_model().objects.filter(deleted=False, + post_type__in=ALLOWED_TYPES) class UserIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) |