fix resource aggregations when not found dataset

This commit is contained in:
Jorge Pastor 2024-03-11 13:49:03 +01:00
parent ae88cc4911
commit d29ffa900d
1 changed files with 2 additions and 1 deletions

View File

@ -34,7 +34,8 @@ class Last(Aggregation):
def filter(self, dataset, date=None): def filter(self, dataset, date=None):
lastdataset = dataset.order_by('-id').first() lastdataset = dataset.order_by('-id').first()
dataset = dataset.filter( launch_id=lastdataset.launch_id) if lastdataset is not None:
dataset = dataset.filter( launch_id=lastdataset.launch_id)
# now = timezone.now() # now = timezone.now()
# epoch = now - datetime.timedelta(minutes=2) # epoch = now - datetime.timedelta(minutes=2)
# dataset = dataset.filter( created_at__range=(epoch, now )) # dataset = dataset.filter( created_at__range=(epoch, now ))