1
0
Fork 0

Update LatestTleSet entries after removing TLE source from distributable ones

Fixes https://gitlab.com/librespacefoundation/satnogs/satnogs-db/-/issues/501

Signed-off-by: George Sfoungaris <sfou@libre.space>
spacecruft
George Sfoungaris 2022-10-26 14:46:07 +03:00 committed by Alfredos-Panagiotis Damkalis
parent a94d14ba71
commit 78c52e7ead
1 changed files with 5 additions and 0 deletions

View File

@ -60,6 +60,11 @@ def update_latest_tle_sets(satellite_pks=None):
tle_id = tle_ids[0] if tle_ids[0] else 0
tle_id_dist = tle_ids[1] if tle_ids[1] else 0
if tle_id_dist:
tle_dist = Tle.objects.get(id=tle_id_dist)
if tle_dist.tle_source not in settings.TLE_SOURCES_REDISTRIBUTABLE:
tle_id_dist = 0
# Query for the latest Tle set for this satellite
sub_subquery = Tle.objects.filter(
pk__gte=tle_id, satellite=satellite