- Entfernen des automatischen Kick-Mechanismus

- Fix #105
This commit is contained in:
Juhn-Vitus Saß
2025-04-21 13:35:51 +02:00
parent 9245f928dc
commit 7faf931fb2
6 changed files with 46 additions and 170 deletions

View File

@@ -0,0 +1,13 @@
from django.core.management.base import BaseCommand
from play.models import QuizGame
from django.utils import timezone
class Command(BaseCommand):
help = 'Bereinigt beendete Spiele'
def handle(self, *args, **kwargs):
expired_games = QuizGame.objects.filter(
updated_at__lt=timezone.now() - timezone.timedelta(minutes=5))
deleted_count = expired_games.count()
expired_games.delete()
self.stdout.write(f'{deleted_count} alte Spiele gelöscht.')