mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #29133 -- Fixed call_command() crash if a required option is passed in options.
This commit is contained in:
parent
40bac28faa
commit
a1a3e51561
3 changed files with 31 additions and 1 deletions
11
tests/user_commands/management/commands/required_option.py
Normal file
11
tests/user_commands/management/commands/required_option.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
from django.core.management.base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument('-n', '--need-me', required=True)
|
||||
parser.add_argument('-t', '--need-me-too', required=True, dest='needme2')
|
||||
|
||||
def handle(self, *args, **options):
|
||||
self.stdout.write(','.join(options))
|
Loading…
Add table
Add a link
Reference in a new issue