From 6cfbc4ed9a70b8fbfdd08294ae35a7bf36e95ac8 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sat, 5 May 2018 22:08:06 -0400 Subject: added distinct to wildlife query to handle places we've visited twice. --- app/jrnl/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jrnl/views.py b/app/jrnl/views.py index 75501f4..980038c 100644 --- a/app/jrnl/views.py +++ b/app/jrnl/views.py @@ -82,7 +82,7 @@ class EntryDetailView(DetailView): def get_context_data(self, **kwargs): context = super(EntryDetailView, self).get_context_data(**kwargs) - context['wildlife'] = Sighting.objects.filter(location=self.get_object().location).order_by('ap__apclass__kind') + context['wildlife'] = Sighting.objects.filter(location=self.get_object().location).distinct().order_by('ap__apclass__kind') return context class EntryDetailViewTXT(EntryDetailView): -- cgit v1.2.3