feat(submissions): sync scopes admin from token

This commit is contained in:
2026-10-16 01:34:56 +02:00
parent 8daa91d6c5
commit de5ee8ae7a
13 changed files with 480 additions and 40 deletions
@@ -1,7 +1,7 @@
from django.core.management.base import BaseCommand, CommandError
from games.models import EventGame
from submissions.tasks import sync_all_event_games_task, sync_event_game_scopes_task
from submissions.tasks import schedule_scope_sync, sync_all_event_games_task
class Command(BaseCommand):
@@ -25,10 +25,16 @@ class Command(BaseCommand):
if not EventGame.objects.filter(id=event_game_id).exists():
raise CommandError(f"No EventGame with id={event_game_id}")
sync_event_game_scopes_task.enqueue(event_game_id)
self.stdout.write(
self.style.SUCCESS(f"Queued sync for EventGame {event_game_id}")
)
if schedule_scope_sync(event_game_id):
self.stdout.write(
self.style.SUCCESS(f"Started sync for EventGame {event_game_id}")
)
else:
self.stdout.write(
self.style.WARNING(
f"Sync already running for EventGame {event_game_id}"
)
)
return
if (