From 306394e0115dc1b2660e8fdc26b2403614bf68bc Mon Sep 17 00:00:00 2001 From: Ben Thorner Date: Fri, 3 Sep 2021 12:28:58 +0100 Subject: [PATCH] Small fixes for command to migrate areas Previously there was no way to run it for reals. --- app/commands.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/commands.py b/app/commands.py index 67a971f6c..4437e9005 100644 --- a/app/commands.py +++ b/app/commands.py @@ -13,8 +13,9 @@ def list_routes(): @click.command() @click.argument('csv_path') +@click.argument('for_reals') @with_appcontext -def tmp_backfill_areas(csv_path, dry_run=True): +def tmp_backfill_areas(csv_path, for_reals=False): import csv from app.models.broadcast_message import BroadcastMessage @@ -23,7 +24,7 @@ def tmp_backfill_areas(csv_path, dry_run=True): message = BroadcastMessage.from_id(id, service_id=service_id) print(f'Updating {message.id}') # noqa - if not dry_run: + if for_reals: message._update_areas(force_override=True)