Commits

Andrew Godwin committed ab02739

Fix #427: Load initial data whenever an app is migrated to most recent, even if it's a no-op.

  • Participants
  • Parent commits 0505afa

Comments (0)

Files changed (2)

south/migration/__init__.py

         if success:
             post_migrate.send(None, app=app_label)
     elif verbosity:
+        # Say there's nothing.
         print '- Nothing to migrate.'
+        # If we have initial data enabled, and we're at the most recent
+        # migration, do initial data.
+        # Note: We use a fake Forwards() migrator here. It's never used really.
+        migrator = LoadInitialDataMigrator(migrator=Forwards(verbosity=verbosity))
+        migrator.load_initial_data(target)
+        # Send signal.
         post_migrate.send(None, app=app_label)

south/migration/migrators.py

 
 
 class LoadInitialDataMigrator(MigratorWrapper):
+    
     def load_initial_data(self, target):
         if target is None or target != target.migrations[-1]:
             return