mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #27787 -- Made call_command() validate the options it receives.
This commit is contained in:
committed by
Tim Graham
parent
92e286498a
commit
2b09e4c88e
@@ -384,6 +384,18 @@ raises an exception and should be replaced with::
|
||||
|
||||
forms.IntegerField(max_value=25, min_value=10)
|
||||
|
||||
``call_command()`` validates the options it receives
|
||||
----------------------------------------------------
|
||||
|
||||
``call_command()`` now validates that the argument parser of the command being
|
||||
called defines all of the options passed to ``call_command()``.
|
||||
|
||||
For custom management commands that use options not created using
|
||||
``parser.add_argument()``, add a ``stealth_options`` attribute on the command::
|
||||
|
||||
class MyCommand(BaseCommand):
|
||||
stealth_options = ('option_name', ...)
|
||||
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user