Use .first() instead of [0]... thanks elrond :)
This commit is contained in:
parent
23f4c6b2fd
commit
851df6214e
@ -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):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user