From: Emilie Date: Fri, 21 Oct 2016 09:56:21 +0000 (+0200) Subject: Media: current type X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=cbe9bec436c7f4aa9c707fe33dc8c4c92a835fab;p=mezzo.git Media: current type --- diff --git a/app/organization/media/views.py b/app/organization/media/views.py index 170da8c9..599cf9ce 100644 --- a/app/organization/media/views.py +++ b/app/organization/media/views.py @@ -24,11 +24,14 @@ class PlaylistListView(ListView): context_object_name = 'playlists' def get_queryset(self): qs = Playlist.objects.all() + self.current_type = None if "type" in self.kwargs: qs = qs.filter(type=self.kwargs['type']) + self.current_type = self.kwargs['type'] return qs def get_context_data(self, **kwargs): context = super(PlaylistListView, self).get_context_data(**kwargs) + context['current_type'] = self.current_type return context