Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Handle Apps with South migrations as unmigrated apps.

  • Loading branch information...
commit ed8919cbcb83302ea71572f5c7d5e6796bb21afa 1 parent 975415a
@apollo13 apollo13 authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 django/db/migrations/loader.py
View
9 django/db/migrations/loader.py
@@ -81,20 +81,25 @@ def load_disk(self):
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_"
Please sign in to comment.
Something went wrong with that request. Please try again.