Opened 13 years ago
Closed 12 years ago
#16802 closed New feature (fixed)
Core management commands should have defined success/fail semantics
Reported by: | Jeremy Dunck | Owned by: | nobody |
---|---|---|---|
Component: | Core (Management commands) | Version: | 1.3 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
call_command('loaddata'...) does not throw an exception if loading the fixture fails. I was trying to use this in a test runner, and it would be nice to early-exit the runner if a fixture load fails.
It would be nice of call_command returned False or threw an exception upon the command failing.
Change History (2)
comment:1 by , 13 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
loaddata does now raises CommandError on failure (6fd1950a4e29c1b5ed071a880db64103715ead51).
Note:
See TracTickets
for help on using tickets.
I almost opened this exact same ticket yesterday. It will require some reworking of the overall machinery for management commands since right now returned values are treated as if they should be output to the user instead of treated as return codes, but overall this is quite necessary.