]> git.parisson.com Git - teleforma.git/commitdiff
cleanup course list view context
authorGuillaume Pellerin <yomguy@parisson.com>
Wed, 19 Feb 2014 01:36:58 +0000 (02:36 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Wed, 19 Feb 2014 01:37:28 +0000 (02:37 +0100)
teleforma/views/core.py

index 8987cbff3ff2cef738501af83c5c68e184158bea..ebfbbc0429562cc78c2a4b0d067d70d77e8e7c18 100644 (file)
@@ -211,20 +211,11 @@ class CourseAccessMixin(object):
         return super(CourseAccessMixin, self).render_to_response(context)
 
 
-class CourseListView(CourseAccessMixin, ListView):
+class CourseListView(ListView):
 
     model = Course
     template_name='teleforma/courses.html'
 
-    def get_context_data(self, **kwargs):
-        context = super(CourseListView, self).get_context_data(**kwargs)
-        context['notes'] = Note.objects.filter(author=self.request.user)
-        context['room'] = get_room(name='site', period=context['period'].name)
-        context['doc_types'] = DocumentType.objects.all()
-        context['list_view'] = True
-        context['courses'] = sorted(context['all_courses'], key=lambda k: k['date'], reverse=True)[:5]
-        return context
-
     @method_decorator(login_required)
     def dispatch(self, *args, **kwargs):
         return super(CourseListView, self).dispatch(*args, **kwargs)