Commits

gterzian committed a257841

added test for app's existence

Comments (0)

Files changed (1)

south/management/commands/schemamigration.py

         
         if not app:
             self.error("You must provide an app to create a migration for.\n" + self.usage_str)
-        
+	    
+        # See if the app exists
+        app = app.split(".")[-1]
+        try:
+            app_module = models.get_app(app)
+        except ImproperlyConfigured:
+            print("There is no enabled application matching '%s'." % app)
+            return
+	
         # Get the Migrations for this app (creating the migrations dir if needed)
         migrations = Migrations(app, force_creation=True, verbose_creation=int(verbosity) > 0)