diff options
| author | Florian Apolloner <florian@apolloner.eu> | 2013-10-15 11:57:30 +0200 |
|---|---|---|
| committer | Florian Apolloner <florian@apolloner.eu> | 2013-10-15 11:57:30 +0200 |
| commit | ed8919cbcb83302ea71572f5c7d5e6796bb21afa (patch) | |
| tree | 0349cc439ec41d30688e2e446d92fca63eb1bcf5 | |
| parent | 975415a8cef38cf2a49c3ce8234c15ef97a69b5f (diff) | |
Handle Apps with South migrations as unmigrated apps.
| -rw-r--r-- | django/db/migrations/loader.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py index 2a20e37ff1..846f0b8eaf 100644 --- a/django/db/migrations/loader.py +++ b/django/db/migrations/loader.py @@ -81,20 +81,25 @@ class MigrationLoader(object): if import_name[0] not in "_.~": migration_names.add(import_name) # Load them + south_style_migrations = False for migration_name in migration_names: try: migration_module = import_module("%s.%s" % (module_name, migration_name)) except ImportError as e: # Ignore South import errors, as we're triggering them if "south" in str(e).lower(): - continue + south_style_migrations = True + break raise if not hasattr(migration_module, "Migration"): raise BadMigrationError("Migration %s in app %s has no Migration class" % (migration_name, app_label)) # Ignore South-style migrations if hasattr(migration_module.Migration, "forwards"): - continue + south_style_migrations = True + break self.disk_migrations[app_label, migration_name] = migration_module.Migration(migration_name, app_label) + if south_style_migrations: + self.unmigrated_apps.add(app_label) def get_migration_by_prefix(self, app_label, name_prefix): "Returns the migration(s) which match the given app label and name _prefix_" |
