diff --git a/chroniker/models.py b/chroniker/models.py index 76cb3b5..c30eaa4 100644 --- a/chroniker/models.py +++ b/chroniker/models.py @@ -730,7 +730,7 @@ def save(self, **kwargs): log_q = self.logs.all().order_by('-run_start_datetime')[cutoff:] if log_q.exists(): cutoff_dt = log_q[0].run_start_datetime - qs = Log.objects.filter(run_start_datetime__lte=cutoff_dt) + qs = Log.objects.filter(job=self.id, run_start_datetime__lte=cutoff_dt) for o in qs: o.delete()