]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/views/meta.py
enabling the CSRF protection middleware and adding the {% csrf_token %} tag to the...
[osqa.git] / forum / views / meta.py
index a0c5cede68f84b5d49c2c6cae90e0ee2abf489f7..436676dfa7e462e86d30d1762270e80261a2d3e7 100644 (file)
@@ -88,7 +88,7 @@ def logout(request):
 
 @decorators.render('badges.html', 'badges', _('badges'), weight=300)
 def badges(request):
 
 @decorators.render('badges.html', 'badges', _('badges'), weight=300)
 def badges(request):
-    badges = [b.ondb for b in sorted(BadgesMeta.by_id.values(), lambda b1, b2: cmp(b1.name, b2.name))]
+    badges = sorted([Badge.objects.get(id=id) for id in BadgesMeta.by_id.keys()], lambda b1, b2: cmp(b1.name, b2.name))
 
     if request.user.is_authenticated():
         my_badges = Award.objects.filter(user=request.user).values('badge_id').distinct()
 
     if request.user.is_authenticated():
         my_badges = Award.objects.filter(user=request.user).values('badge_id').distinct()