From 851df6214ee0332eb45282702524934cdb9ebcf7 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 2 Jan 2012 13:59:36 -0600 Subject: [PATCH] Use .first() instead of [0]... thanks elrond :) --- mediagoblin/db/sql/util.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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): """ -- 2.25.1