#33430: Calling command via `call_command` with option that is `required` and
has
set `dest` leads to an error
-------------------------------------+-------------------------------------
Reporter: Adam Mičuda | Owner: ravi
| kunwar
Type: Bug | Status: closed
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Adam Mičuda):
Hi @Ravi,
I'm sorry for not providing these informations. I use Python 3.9.6 and
Django 3.2.10.
Hi @Mariusz,
Oh, you are right. Thank you. I have one note to this: I think the
behaviour is kind of confusing from dev experience.
Lets have an option with the `dest` set, e.g.
{{{
parser.add_argument('--from', dest='from_')
}}}
It is possible to call `call_command` as
{{{
call_command('bug_report', **{ 'from': '2022-01-11' })
}}}
and
{{{
call_command('bug_report', **{ 'from_': '2022-01-11' })
}}}
either. But if the option is `required` the first call is not possible. I
believe the behaviour should be consistent regardless of whether the
option is required or not. What do you think?
--
Ticket URL: <https://code.djangoproject.com/ticket/33430#comment:4>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.e410a598c0ce4ec1ae4c1d82bfec97ca%40djangoproject.com.