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.
|
||||
"""
|
||||
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):
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user