Fix database_current_version for when self.migration_data is None.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 29 Jan 2012 23:05:16 +0000 (17:05 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 29 Jan 2012 23:05:16 +0000 (17:05 -0600)
mediagoblin/db/sql/util.py

index 87234019929d76450fdbe1986e7c83797019320d..cb8fbf0df6be74696f5723ad24257977ef3852cd 100644 (file)
@@ -97,6 +97,10 @@ class MigrationManager(object):
         if not self.migration_table.exists(self.database.bind):
             return None
 
+        # Also return None if self.migration_data is None.
+        if self.migration_data is None:
+            return None
+
         return self.migration_data.version
 
     def set_current_migration(self, migration_number):