From: Christopher Allan Webber Date: Mon, 2 Jan 2012 19:59:36 +0000 (-0600) Subject: Use .first() instead of [0]... thanks elrond :) X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=851df6214ee0332eb45282702524934cdb9ebcf7;p=mediagoblin.git Use .first() instead of [0]... thanks elrond :) --- diff --git a/mediagoblin/db/sql/util.py b/mediagoblin/db/sql/util.py index 4938bcad..dfc36a61 100644 --- a/mediagoblin/db/sql/util.py +++ b/mediagoblin/db/sql/util.py @@ -73,11 +73,8 @@ class MigrationManager(object): """ Get the migration row associated with this object, if any. """ - query = self.database.query( - self.migration_model).filter_by(name=self.name)[0] - - if query.count(): - return query[0] + return self.database.query( + self.migration_model).filter_by(name=self.name).first() def latest_migration(self): """