mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #25483 -- Allowed passing non-string arguments to call_command
Thanks KS Chan for the report and Tim Graham for the review.
This commit is contained in:
parent
fa2e1e633a
commit
3f22e83e90
3 changed files with 13 additions and 1 deletions
|
@ -7,6 +7,7 @@ class Command(BaseCommand):
|
|||
requires_system_checks = True
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument("integer", nargs='?', type=int, default=0)
|
||||
parser.add_argument("-s", "--style", default="Rock'n'Roll")
|
||||
parser.add_argument("-x", "--example")
|
||||
parser.add_argument("--opt-3", action='store_true', dest='option3')
|
||||
|
@ -18,3 +19,5 @@ class Command(BaseCommand):
|
|||
if options['verbosity'] > 0:
|
||||
self.stdout.write("I don't feel like dancing %s." % options["style"])
|
||||
self.stdout.write(','.join(options.keys()))
|
||||
if options['integer'] > 0:
|
||||
self.stdout.write("You passed %d as a positional argument." % options['integer'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue