]> git.parisson.com Git - mezzo.git/commitdiff
fix video and artist publishing
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 23 May 2016 15:54:05 +0000 (17:54 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 23 May 2016 15:54:36 +0000 (17:54 +0200)
app/festival/models.py
app/festival/views.py
app/templates/base.html

index f937090b3e171e575672960007352e33ae86e350..15a96562907ff97f944d47c2f291b7c5497e7cba 100644 (file)
@@ -218,4 +218,4 @@ class VideoCategory(Slugged):
         db_table = app_label + '_video_category'
 
     def count(self):
-        return self.videos.all().count()
+        return self.videos.published().count()+1
index 29f462858fa42a1615a52a006450fb0b3966d69e..75feeaacab8aee9d088850fe4d76bae08e49679b 100644 (file)
@@ -19,6 +19,9 @@ class ArtistListView(ListView):
     model = Artist
     template_name='festival/artist_list.html'
 
+    def get_queryset(self, **kwargs):
+        return self.model.objects.published()
+
     def get_context_data(self, **kwargs):
         context = super(ArtistListView, self).get_context_data(**kwargs)
         return context
@@ -40,6 +43,9 @@ class VideoListView(ListView):
     model = Video
     template_name='festival/video_list.html'
 
+    def get_queryset(self, **kwargs):
+        return self.model.objects.published()
+
     def get_context_data(self, **kwargs):
         context = super(VideoListView, self).get_context_data(**kwargs)
         context['categories'] = VideoCategory.objects.all()
index 64cafbeb01aa15ad9d8bae05a3702922981533d2..e09d7ce006905b9a37e7d84c0cb11e23d90077a8 100644 (file)
 
 </script>
 </html>
+