summaryrefslogtreecommitdiffstats
path: root/forum/views.py
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
commitd773e8fa5a777d36242ed0777fcc25fe7a4231b7 (patch)
treedfd424b7a97f1c5f4ce18839e5c44c1c1fc92e30 /forum/views.py
parenta32975a5d8acf5fa54f544271e2cfb9e92bbf8bf (diff)
downloadaskbot-d773e8fa5a777d36242ed0777fcc25fe7a4231b7.tar.gz
askbot-d773e8fa5a777d36242ed0777fcc25fe7a4231b7.tar.bz2
askbot-d773e8fa5a777d36242ed0777fcc25fe7a4231b7.zip
fixing error on import in forum/views to work with django version < 1.1
Diffstat (limited to 'forum/views.py')
-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,