#27000 closed Cleanup/optimization (fixed)
Django manage Command.usage() is broken
| Reported by: | Ilya | Owned by: | nobody |
|---|---|---|---|
| Component: | Core (Management commands) | Version: | 1.10 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
This method access self.args which is not set.
How to reproduce:
import os
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "untitled8.settings")
django.setup()
from django.core.management.commands import createcachetable
createcachetable.Command().usage("")
Result:
usage = '%%prog %s [options] %s' % (subcommand, self.args) AttributeError: 'Command' object has no attribute 'args'
Change History (4)
comment:1 by , 9 years ago
| Has patch: | set |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
| Type: | Bug → Cleanup/optimization |
comment:2 by , 9 years ago
@throwable-one, you can probably achieve similar result by using Command().create_parser.
Note:
See TracTickets
for help on using tickets.
It looks like that method should have been removed along with
optparsesupport in 6a70cb53971a19f2d9e71d5ee24bfb0e844b4d9d.PR