Opened 16 years ago

Closed 16 years ago

#6782 closed (duplicate)

reset on apps without models causes exception

Reported by: niklas@… 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 Malcolm Tredinnick)

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\", line 249, in <module>
  File "S:\nc\Projects\Inventive\Ticmate\svn\ticmate\trunk\source\python\ticmate\django\scripts\", line 90, in tr_reset
  File "S:\nc\Projects\Inventive\Ticmate\svn\ticmate\trunk\source\python\ticmate\django\scripts\", line 145, in tr_reset_no_reload
  File "S:\nc\Projects\Inventive\Ticmate\svn\ticmate\trunk\source\python\ticmate\django\scripts\", line 149, in tr_reset_apps
  File "S:\nc\Projects\Inventive\Ticmate\svn\ticmate\trunk\source\python\ticmate\django\scripts\", 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\", line 126, in call_command
    return klass.execute(*args, **options)
  File "S:\nc\Projects\Inventive\Ticmate\svn\django-trunk\django\core\management\", line 86, in execute
    output = self.handle(*args, **options)
  File "S:\nc\Projects\Inventive\Ticmate\svn\django-trunk\django\core\management\", line 136, in handle
    app_output = self.handle_app(app, **options)
  File "S:\nc\Projects\Inventive\Ticmate\svn\django-trunk\django\core\management\commands\", line 24, in handle_app
    sql_list = sql_reset(app,
  File "S:\nc\Projects\Inventive\Ticmate\svn\django-trunk\django\core\management\", 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\", 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 anonymous, 16 years ago

It looks a bit messy but I don't know how to edit the description. Thought i might put it in instead?

comment:2 by Malcolm Tredinnick, 16 years ago

Description: modified (diff)
Triage Stage: UnreviewedAccepted

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.

comment:3 by loppear, 16 years ago

Resolution: duplicate
Status: newclosed

Duplicate of ticket:5066

Note: See TracTickets for help on using tickets.
Back to Top