1
0
Fork 0

Merge branch 'active-observers' into 'dev'

Exclude observers with no observations

See merge request librespacefoundation/satnogs/satnogs-network!491
environments/stage/deployments/118
Pierros Papadeas 2018-05-23 18:04:26 +00:00
commit 5f13151287
1 changed files with 3 additions and 1 deletions

View File

@ -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)