]> git.0d.be Git - panikweb.git/commitdiff
misc: avoid duplicates in archives
authorFrédéric Péters <fpeters@0d.be>
Sat, 21 Jul 2018 17:13:45 +0000 (19:13 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sat, 21 Jul 2018 17:13:45 +0000 (19:13 +0200)
panikweb/views.py

index 1042aa26bf7ba0cc672774b8aab978e6f26bfa76..04cd4302e5f600e67118863b1443742289bb796a 100644 (file)
@@ -870,7 +870,7 @@ class ArchivesView(TemplateView):
 
     def get_context_data(self, **kwargs):
         context = super(ArchivesView, self).get_context_data(**kwargs)
-        context['diffusions'] = Diffusion.objects.filter(episode__soundfile__isnull=False).select_related().order_by('-datetime')
+        context['diffusions'] = Diffusion.objects.filter(episode__soundfile__isnull=False).distinct().order_by('-datetime')
         return context
 
 archives = ArchivesView.as_view()