]> git.parisson.com Git - teleforma.git/commitdiff
fix args
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 16 Jan 2023 17:00:11 +0000 (18:00 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 16 Jan 2023 17:00:11 +0000 (18:00 +0100)
teleforma/management/commands/teleforma-update-site.py

index a68da18abfbaba4212654f8843a985b9a3501eec..2f73e82ac97d435c022461fe9bf1de6eac3cab7b 100644 (file)
@@ -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