updating for TemplateView changes in 1.5
authorBryan <btbonval@gmail.com>
Sun, 12 Jan 2014 06:23:33 +0000 (06:23 +0000)
committerBryan <btbonval@gmail.com>
Sun, 12 Jan 2014 06:23:33 +0000 (06:23 +0000)
karmaworld/apps/courses/views.py

index 23d62bfff2c1a06883005e39f8846525a9144c71..f23a68974211efbd2e90693ad55e4b54e3eba494 100644 (file)
@@ -81,9 +81,9 @@ class AboutView(TemplateView):
 
     def get_context_data(self, **kwargs):
         """ get the list of schools with the most files for leaderboard """
-        context = { 'params': kwargs,
-                    'schools': School.objects.filter(file_count__gt=0).order_by('-file_count')[:20] }
-        return context
+        if 'schools' not in kwargs:
+            kwargs['schools'] = School.objects.filter(file_count__gt=0).order_by('-file_count')[:20]
+        return kwargs
 
 
 def school_list(request):