From a40b8b83827e6beac74435009e7c462cdcc7b91e Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Wed, 19 Feb 2014 02:36:58 +0100 Subject: [PATCH] cleanup course list view context --- teleforma/views/core.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/teleforma/views/core.py b/teleforma/views/core.py index 8987cbff..ebfbbc04 100644 --- a/teleforma/views/core.py +++ b/teleforma/views/core.py @@ -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) -- 2.39.5