Exclude observers with no observations
parent
f92024db37
commit
883978e74a
|
@ -178,7 +178,9 @@ class ObservationListView(ListView):
|
|||
"""
|
||||
context = super(ObservationListView, self).get_context_data(**kwargs)
|
||||
context['satellites'] = Satellite.objects.all()
|
||||
context['authors'] = User.objects.all().order_by('first_name', 'last_name', 'username')
|
||||
context['authors'] = User.objects.annotate(obs_count=Count('observations')) \
|
||||
.filter(obs_count__gt=0) \
|
||||
.order_by('first_name', 'last_name', 'username')
|
||||
context['stations'] = Station.objects.all().order_by('id')
|
||||
norad_cat_id = self.request.GET.get('norad', None)
|
||||
observer = self.request.GET.get('observer', None)
|
||||
|
|
Loading…
Reference in New Issue