Opened 17 years ago
Closed 17 years ago
#6782 closed (duplicate)
reset on apps without models causes exception
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | 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 (last modified by )
The orders and customers apps contain no models. This causes the exception below
apps = ['resources', 'orders', 'common', 'customers'] management.call_command('reset', *apps) Traceback (most recent call last): File "S:\nc\Projects\Inventive\Ticmate\svn\ticmate\trunk\source\python\ticmate\django\scripts\ticrun.py", line 249, in <module> func() File "S:\nc\Projects\Inventive\Ticmate\svn\ticmate\trunk\source\python\ticmate\django\scripts\ticrun.py", line 90, in tr_reset tr_reset_no_reload() File "S:\nc\Projects\Inventive\Ticmate\svn\ticmate\trunk\source\python\ticmate\django\scripts\ticrun.py", line 145, in tr_reset_no_reload tr_reset_apps() File "S:\nc\Projects\Inventive\Ticmate\svn\ticmate\trunk\source\python\ticmate\django\scripts\ticrun.py", line 149, in tr_reset_apps reset_apps() File "S:\nc\Projects\Inventive\Ticmate\svn\ticmate\trunk\source\python\ticmate\django\scripts\ticrun.py", line 171, in reset_apps management.call_command('reset', *apps)#, verbosity=2, noinput=True) File "S:\nc\Projects\Inventive\Ticmate\svn\django-trunk\django\core\management\__init__.py", line 126, in call_command return klass.execute(*args, **options) File "S:\nc\Projects\Inventive\Ticmate\svn\django-trunk\django\core\management\base.py", line 86, in execute output = self.handle(*args, **options) File "S:\nc\Projects\Inventive\Ticmate\svn\django-trunk\django\core\management\base.py", line 136, in handle app_output = self.handle_app(app, **options) File "S:\nc\Projects\Inventive\Ticmate\svn\django-trunk\django\core\management\commands\reset.py", line 24, in handle_app sql_list = sql_reset(app, self.style) File "S:\nc\Projects\Inventive\Ticmate\svn\django-trunk\django\core\management\sql.py", line 206, in sql_reset return sql_delete(app, style) + sql_all(app, style) File "S:\nc\Projects\Inventive\Ticmate\svn\django-trunk\django\core\management\sql.py", line 194, in sql_delete app_label = app_models[0]._meta.app_label IndexError: list index out of range
Change History (3)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
Description: | modified (diff) |
---|---|
Triage Stage: | Unreviewed → Accepted |
Fixed description.
Since it makes no sense to run "reset" on an app with no models, the solution here is "don't do that". Maybe somebody will fix it at some point, but it's not particularly high priority.
Note:
See TracTickets
for help on using tickets.
It looks a bit messy but I don't know how to edit the description. Thought i might put it in dpaste.com instead?