From 43b6bf636e318eda93b7ce2011ace28f129626c1 Mon Sep 17 00:00:00 2001 From: jefer94 Date: Mon, 16 Dec 2024 17:43:34 -0500 Subject: [PATCH] improve deletion command --- .../management/commands/schedule_repository_deletions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/breathecode/assignments/management/commands/schedule_repository_deletions.py b/breathecode/assignments/management/commands/schedule_repository_deletions.py index f8b86b507..a7fb3215c 100644 --- a/breathecode/assignments/management/commands/schedule_repository_deletions.py +++ b/breathecode/assignments/management/commands/schedule_repository_deletions.py @@ -130,8 +130,8 @@ def purge_deletion_orders(self): page = 0 to_delete = [] while True: - qs = RepositoryDeletionOrder.objects.filter( - status=RepositoryDeletionOrder.Status.PENDING, + qs = RepositoryDeletionOrder.objects.exclude( + status__in=[RepositoryDeletionOrder.Status.TRANSFERRED, RepositoryDeletionOrder.Status.DELETED] )[page * 100 : (page + 1) * 100] if len(qs) == 0: