Skip to content

Commit

Permalink
only delete own logs
Browse files Browse the repository at this point in the history
  • Loading branch information
huimin committed May 29, 2023
1 parent d795cd1 commit 6ad2465
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chroniker/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 6ad2465

Please sign in to comment.