fix haystack search

This commit is contained in:
slav0nic 2011-10-11 13:35:07 +03:00
parent 18ec1439ff
commit f46fce38d7
3 changed files with 7 additions and 7 deletions
djangobb_forum
templates/djangobb_forum
views.py
extras

View file

@ -14,23 +14,23 @@
{% if results %}
{% for post in results %}
<div class="blockpost searchposts roweven">
<h2>{% link post.instance.topic.forum %}&nbsp;&raquo;&nbsp;{% link post.instance.topic %}&nbsp;&raquo;&nbsp;<a href="{{ post.instance.get_absolute_url }}">{% forum_time post.instance.created %}</a></h2>
<h2>{% link post.object.topic.forum %}&nbsp;&raquo;&nbsp;{% link post.object.topic %}&nbsp;&raquo;&nbsp;<a href="{{ post.object.get_absolute_url }}">{% forum_time post.object.created %}</a></h2>
<div class="box">
<div class="inbox">
<div class="postleft">
<dl>
<dt><strong><a href="{% url djangobb:forum_profile post.instance.user %}">{{ post.instance.user }}</a></strong></dt>
<dd>{% trans "Replies:" %} {{ post.instance.topic.post_count }}</dd>
<dt><strong><a href="{% url djangobb:forum_profile post.object.user %}">{{ post.object.user }}</a></strong></dt>
<dd>{% trans "Replies:" %} {{ post.object.topic.post_count }}</dd>
<dd><div class="icon"><div class="nosize"><!-- --></div></div>
</dd>
<dd><p class="clearb"><a href="{{ post.instance.get_absolute_url }}">{% trans "Go to post" %}</a></p></dd>
<dd><p class="clearb"><a href="{{ post.object.get_absolute_url }}">{% trans "Go to post" %}</a></p></dd>
</dl>
</div>
<div class="postright">
<div class="postmsg">
{{ post.instance.body_html|safe }}
{{ post.object.body_html|safe }}
</div>
</div>

View file

@ -178,7 +178,7 @@ def search(request):
if 'topics' in request.GET['show_as']:
topics = []
topics_to_exclude = []
topics_to_exclude = SQ()
for post in posts:
if post.object.topic not in topics:
if post.object.topic.forum.category.has_access(request.user):

View file

@ -1,6 +1,6 @@
Django>=1.2
PIL>=1.1.7
django-haystack>=1.1.0
django-haystack>=1.2.5
south
django-messages==0.4.4
pygments