summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdolfo Fitoria <fitoria@fitoria-laptop.(none)>2009-08-16 20:17:23 -0600
committerAdolfo Fitoria <fitoria@fitoria-laptop.(none)>2009-08-16 20:17:23 -0600
commitb93c3470b92370b8b010c3a96598b6f68dbd24bb (patch)
treedfd424b7a97f1c5f4ce18839e5c44c1c1fc92e30
parent1404416412a50d00719d4f3d6f84dbda75e811b7 (diff)
downloadaskbot-b93c3470b92370b8b010c3a96598b6f68dbd24bb.tar.gz
askbot-b93c3470b92370b8b010c3a96598b6f68dbd24bb.tar.bz2
askbot-b93c3470b92370b8b010c3a96598b6f68dbd24bb.zip
fixing error on import in forum/views to work with django version < 1.1
-rw-r--r--forum/views.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/forum/views.py b/forum/views.py
index d663a4cb..ce722118 100644
--- a/forum/views.py
+++ b/forum/views.py
@@ -1149,8 +1149,12 @@ def user_stats(request, user_id, user_view):
params=[user.id]
).values('id', 'name', 'description', 'type')
total_awards = awards.count()
- from django.db.models import Count
- awards = awards.annotate(count = Count('badge__id'))
+ #fixed to work with Django version < 1.1
+ try:
+ from django.db.models import Count
+ awards = awards.annotate(count = Count('badge__id'))
+ except:
+ pass
return render_to_response(user_view.template_file,{
"tab_name" : user_view.id,