Use .first() instead of [0]... thanks elrond :)

This commit is contained in:
Christopher Allan Webber 2012-01-02 13:59:36 -06:00
parent 23f4c6b2fd
commit 851df6214e

View File

@ -73,11 +73,8 @@ class MigrationManager(object):
""" """
Get the migration row associated with this object, if any. Get the migration row associated with this object, if any.
""" """
query = self.database.query( return self.database.query(
self.migration_model).filter_by(name=self.name)[0] self.migration_model).filter_by(name=self.name).first()
if query.count():
return query[0]
def latest_migration(self): def latest_migration(self):
""" """