Modify

Ticket #338 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Historicaly removed app raises django.core.exceptions.ImproperlyConfigured

Reported by: ales.zoulek@… Owned by: andrew
Priority: major Milestone: 0.7
Component: migrations Version: 0.7-pre
Keywords: Cc:

Description

I'm using "trunk" version 617:b52d5e1e4b21 of south. And it seems there is a bug in ignoring missing applications.

./manage.py migrate

Traceback (most recent call last):
  File "./manage.py", line 21, in <module>
    execute_manager(settings)
  File "/home/al3x/PYTHONPATH/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/home/al3x/PYTHONPATH/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/al3x/PYTHONPATH/django/core/management/base.py", line 195, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/al3x/PYTHONPATH/django/core/management/base.py", line 222, in execute
    output = self.handle(*args, **options)
  File "/home/al3x/PYTHONPATH/south/management/commands/migrate.py", line 99, in handle
    database = database,
  File "/home/al3x/PYTHONPATH/south/migration/__init__.py", line 151, in migrate_app
    applied = check_migration_histories(applied)
  File "/home/al3x/PYTHONPATH/south/migration/__init__.py", line 66, in check_migration_histories
    for m in migrations:
  File "/home/al3x/PYTHONPATH/south/migration/__init__.py", line 65, in <genexpr>
    migrations = (h.get_migration() for h in histories)
  File "/home/al3x/PYTHONPATH/south/models.py", line 25, in get_migration
    return self.get_migrations().migration(self.migration)
  File "/home/al3x/PYTHONPATH/south/models.py", line 22, in get_migrations
    return Migrations(self.app_name)
  File "/home/al3x/PYTHONPATH/south/migration/base.py", line 60, in __call__
    self.instances[app_label] = super(MigrationsMetaclass, self).__call__(app_label_to_app_module(app_label), **kwds)
  File "/home/al3x/PYTHONPATH/south/migration/utils.py", line 41, in app_label_to_app_module
    app = models.get_app(app_label)
  File "/home/al3x/PYTHONPATH/django/db/models/loading.py", line 126, in get_app
    raise ImproperlyConfigured("App with label %s could not be found" % app_label)
django.core.exceptions.ImproperlyConfigured: App with label transactions could not be found

I think that check_migration_histories() shoudl call h.get_migration() in try/except block as well. (Patch attached.)

Attachments

south_338_patch.diff (820 bytes) - added by ales.zoulek@… 4 years ago.
patch

Change History

Changed 4 years ago by ales.zoulek@…

patch

comment:1 Changed 4 years ago by andrew

  • Status changed from new to closed
  • Version set to 0.7-pre
  • Resolution set to fixed
  • Milestone set to 0.7

Applied in [bfbc4c55fa94].

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.