This commit is contained in:
Ross
2025-12-09 12:36:18 +00:00
parent e6943ccfc7
commit 40135a282d
6 changed files with 92 additions and 8 deletions
@@ -10,6 +10,8 @@ class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument("rota_id", type=int)
parser.add_argument("--external", action="store_true", help="Use external generator hook if available")
parser.add_argument("--no-export", action="store_true", help="Do not generate HTML export for this run")
parser.add_argument("--no-solve", action="store_true", help="Do not run solver when generating export")
def handle(self, *args, **options):
rota_id = options["rota_id"]
@@ -19,5 +21,12 @@ class Command(BaseCommand):
except RotaSchedule.DoesNotExist:
raise CommandError(f"RotaSchedule with id={rota_id} not found")
run = run_rota_async(rota.id, use_external_generator=use_external)
no_export = options.get("no_export", False)
no_solve = options.get("no_solve", False)
run = run_rota_async(
rota.id,
use_external_generator=use_external,
generate_builder=not no_export,
builder_solve=not no_solve,
)
self.stdout.write(self.style.SUCCESS(f"Started RotaRun id={run.id} for rota={rota.name}"))