id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux 20538,loaddata management command returns exit code of 0 on IntegrityError,Maik Hoepfel ,nobody,"Fixtures get loaded as part of our CI process. Travis builds are reported as passing even though the `loaddata` management command failed to load the fixtures. I'm expecting it to return a non-zero exit code when an error is raised. {{{ (oscar)(master) T530i:django-oscar $ sites/sandbox/manage.py loaddata countries.json sites/_fixtures/p ages.json sites/_fixtures/auth.json sites/_fixtures/ranges.json sites/_fixtures/offers.json Problem installing fixture 'sites/_fixtures/offers.json': Traceback (most recent call last): [...] IntegrityError: Could not load offer.Benefit(pk=2): offer_benefit.type may not be NULL (oscar)(master) T530i:django-oscar $ echo $? 0 }}} [https://gist.github.com/maikhoepfel/5685603 Full stacktrace]. The bug can be replicated by cloning [https://github.com/tangentlabs/django-oscar/commit/44da815651c61cb0f992c5b0944fcde6ce5c9f6f django-oscar] at the selected commit and calling `make sandbox` in a virtualenv. Having said that, I expect this to be an issue with all `IntegrityError`s though. I'm aware there's previous issues that addressed exit codes and propagating a `CommandError`; please note this is ticket not a duplicate of those.",Bug,closed,Core (Management commands),1.5,Normal,fixed,,,Unreviewed,0,0,0,0,0,0