#29133: django.core.management.call_command fails if required option passed in
via
**options
-------------------------------------+-------------------------------------
Reporter: Alex | Owner: nobody
Tomic |
Type: | Status: assigned
Uncategorized |
Component: Core | Version: 2.0
(Management commands) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
If `call_command` is called with a required option, e.g;
{{{
management.call_command('required_option', "--need-me=asdf", "--need-me-
too=fdsa")
management.call_command('required_option', need_me="asdf",
need_me_too="fdsa")
}}}
The first call succeeds, but the second fails with an exception:
{{{
django.core.management.base.CommandError: Error: the following arguments
are required: -n/--need-me, -t/--need-me-too
}}}
The problem is due to `parse_args` being called in `call_command` without
checking for potentially required arguments in `**options`
--
Ticket URL: <https://code.djangoproject.com/ticket/29133>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/051.f2c38c912f1304d49af178e47a554227%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.