Skip to content

Commit

Permalink
related questions were showing deleted questions
Browse files Browse the repository at this point in the history
  • Loading branch information
hrc authored and hrc committed Apr 8, 2010
1 parent db489bc commit 0a199f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion forum/models/question.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def get_related_questions(self, count=10):

if related_list is None:
related_list = Question.objects.values('id').filter(tags__id__in=[t.id for t in self.tags.all()]
).exclude(id=self.id).annotate(frequency=models.Count('id')).order_by('-frequency')[:count]
).exclude(id=self.id, deleted=True).annotate(frequency=models.Count('id')).order_by('-frequency')[:count]
cache.set(cache_key, related_list, 60 * 60)

return [Question.objects.get(id=r['id']) for r in related_list]
Expand Down

0 comments on commit 0a199f6

Please sign in to comment.