1
0
mirror of https://github.com/django/django.git synced 2025-10-28 16:16:12 +00:00

[4.0.x] Fixed #33205 -- Made call_command() raise TypeError when dest with multiple arguments is passed.

Backport of c1e4111c74 from main
This commit is contained in:
Hasan Ramezani
2021-10-22 16:38:14 +02:00
committed by Mariusz Felisiak
parent ac815f6ea8
commit c9ebe4ca4e
3 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def add_arguments(self, parser):
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument('--for', dest='until', action='store')
group.add_argument('--until', action='store')
def handle(self, *args, **options):
for option, value in options.items():
if value is not None:
self.stdout.write('%s=%s' % (option, value))