From 35e38e39f955cb2f9f034a3faac5c350c1f922ea Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 16 Jan 2023 18:00:11 +0100 Subject: [PATCH] fix args --- .../commands/teleforma-update-site.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/teleforma/management/commands/teleforma-update-site.py b/teleforma/management/commands/teleforma-update-site.py index a68da18a..2f73e82a 100644 --- a/teleforma/management/commands/teleforma-update-site.py +++ b/teleforma/management/commands/teleforma-update-site.py @@ -5,10 +5,23 @@ from django.conf import settings class Command(BaseCommand): help = "Change Site domain to another" - + + def add_arguments(self, parser): + parser.add_argument( + '--from', + action='store_true', + help='from domain', + ) + parser.add_argument( + '--to', + action='store_true', + help='to domain', + ) + + def handle(self, *args, **options): - to_domain = args[1] - from_domain = args[0] + from_domain = options['from'] + to_domain = options['to'] site = Site.objects.get(domain=from_domain) site.domain = to_domain -- 2.39.5