From: Guillaume Pellerin Date: Mon, 16 Jan 2023 17:00:11 +0000 (+0100) Subject: fix args X-Git-Tag: 2.8.0~32 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=def66c58625628ef7f84238f15fd3c4bf0d71df8;p=teleforma.git fix args --- 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