1
0
Fork 0

Fix recent data submitters in satellite page

The intent of the "5 recent submitters" on the satellite page is to show the 5 most recent stations and their last submitted time, whereas this was showing the last 5 submissions regardless of the ground station.

Signed-off-by: Corey Shields <cshields@gmail.com>
spacecruft
Corey Shields 2020-07-31 20:49:47 -04:00
parent 95e89dc4b5
commit c1d57a79cb
2 changed files with 2 additions and 2 deletions

View File

@ -167,7 +167,7 @@ def satellite(request, norad):
try:
# pull the last 5 observers and their submission timestamps for this satellite
recent_observers = DemodData.objects.filter(satellite=satellite_obj) \
.values('observer', 'timestamp').annotate(latest_payload=Max('timestamp')) \
.values('observer').annotate(latest_payload=Max('timestamp')) \
.order_by('-latest_payload')[:5]
except (ObjectDoesNotExist, IndexError):
recent_observers = ''

View File

@ -258,7 +258,7 @@
{% for obs in recent_observers %}
<tr>
<td>{{obs.observer}}</td>
<td>{{obs.timestamp|date:"Y-m-d H:i:s"}} UTC</td>
<td>{{obs.latest_payload|date:"Y-m-d H:i:s"}} UTC</td>
</tr>
{% endfor %}
</tbody>