From: Christopher Allan Webber Date: Sun, 29 Jan 2012 22:40:46 +0000 (-0600) Subject: Also switch database_current_migration to a property X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e8ba2223fa2bf79e8998dfbb54794b6a1cb93e63;p=mediagoblin.git Also switch database_current_migration to a property --- diff --git a/mediagoblin/db/sql/util.py b/mediagoblin/db/sql/util.py index 33d2c59b..d9ce7d2b 100644 --- a/mediagoblin/db/sql/util.py +++ b/mediagoblin/db/sql/util.py @@ -88,6 +88,7 @@ class MigrationManager(object): # If no migrations have been set, we start at 0. return 0 + @property def database_current_migration(self): """ Return the current migration in the database. @@ -110,7 +111,7 @@ class MigrationManager(object): """ assert self.database_current_migration is not None - db_current_migration = self.database_current_migration() + db_current_migration = self.database_current_migration return [ (migration_number, migration_func) @@ -145,7 +146,7 @@ class MigrationManager(object): """ Print out a dry run of what we would have upgraded. """ - if self.database_current_migration() is None: + if self.database_current_migration is None: self.printer( u'~> Woulda initialized: %s\n' % self.name_for_printing()) return u'inited' @@ -180,7 +181,7 @@ class MigrationManager(object): # Find out what migration number, if any, this database data is at, # and what the latest is. - migration_number = self.database_current_migration() + migration_number = self.database_current_migration # Is this our first time? Is there even a table entry for # this identifier?