From: Christopher Allan Webber Date: Sun, 29 Jan 2012 23:05:16 +0000 (-0600) Subject: Fix database_current_version for when self.migration_data is None. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=396f39c3e9e5346b4b2e86f6bcce9cdb0c6ee683;p=mediagoblin.git Fix database_current_version for when self.migration_data is None. --- diff --git a/mediagoblin/db/sql/util.py b/mediagoblin/db/sql/util.py index 87234019..cb8fbf0d 100644 --- a/mediagoblin/db/sql/util.py +++ b/mediagoblin/db/sql/util.py @@ -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):