diff options
Diffstat (limited to 'forum')
-rw-r--r-- | forum/managers.py | 2 | ||||
-rw-r--r-- | forum/views.py | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/forum/managers.py b/forum/managers.py index 314f022f..2c05bc5f 100644 --- a/forum/managers.py +++ b/forum/managers.py @@ -24,7 +24,7 @@ class QuestionManager(models.Manager): return questions def get_unanswered_questions(self, orderby): - questions = self.filter(deleted=False, answer_count=0).order_by(orderby) + questions = self.filter(deleted=False, answer_accepted=False).order_by(orderby) return questions def get_questions(self, orderby): diff --git a/forum/views.py b/forum/views.py index 16a5a32d..10438982 100644 --- a/forum/views.py +++ b/forum/views.py @@ -1189,12 +1189,8 @@ def user_stats(request, user_id, user_view): params=[user.id] ).values('id', 'name', 'description', 'type') total_awards = awards.count() - #fixed to work with Django version < 1.1 - try: - from django.db.models import Count - awards = awards.annotate(count = Count('badge__id')) - except: - pass + from django.db.models import Count + awards = awards.annotate(count = Count('badge__id')) return render_to_response(user_view.template_file,{ "tab_name" : user_view.id, |