1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

Fixed #23309 -- Fixed call_command to parse args correctly

This commit is contained in:
Raffaele Salmaso
2014-08-18 00:29:49 +02:00
committed by Claude Paroz
parent 7ed3d0bb61
commit e0a98e2374
4 changed files with 57 additions and 5 deletions

View File

@@ -350,11 +350,7 @@ class BaseCommand(object):
options = parser.parse_args(argv[2:])
cmd_options = vars(options)
# Move positional args out of options to mimic legacy optparse
if 'args' in options:
args = options.args
del cmd_options['args']
else:
args = ()
args = cmd_options.pop('args', ())
else:
options, args = parser.parse_args(argv[2:])
cmd_options = vars(options)