From 29bda0d62064e6e58a73fed17ababc236511a9b2 Mon Sep 17 00:00:00 2001 From: Raz Date: Tue, 15 Apr 2025 16:26:42 +0200 Subject: [PATCH] fix bg tasks --- tournaments/management/commands/check_deadlines.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tournaments/management/commands/check_deadlines.py b/tournaments/management/commands/check_deadlines.py index afeb645..925cd2a 100644 --- a/tournaments/management/commands/check_deadlines.py +++ b/tournaments/management/commands/check_deadlines.py @@ -1,10 +1,12 @@ from django.core.management.base import BaseCommand from tournaments.tasks import check_confirmation_deadlines +from background_task.models import Task class Command(BaseCommand): help = 'Run confirmation deadline check immediately' def handle(self, *args, **options): # Run the function directly (not through the task queue) + Task.objects.filter(task_name='tournaments.tasks.check_confirmation_deadlines').delete() check_confirmation_deadlines() self.stdout.write(self.style.SUCCESS('Successfully checked confirmation deadlines'))