aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/sql/util.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2012-01-02 13:59:36 -0600
committerChristopher Allan Webber <cwebber@dustycloud.org>2012-01-29 16:33:45 -0600
commit851df6214ee0332eb45282702524934cdb9ebcf7 (patch)
tree47fd8747217ed6efd145e3df988af09d320c0f07 /mediagoblin/db/sql/util.py
parent23f4c6b2fd2440433bcb2443633d847ddad17238 (diff)
downloadmediagoblin-851df6214ee0332eb45282702524934cdb9ebcf7.tar.lz
mediagoblin-851df6214ee0332eb45282702524934cdb9ebcf7.tar.xz
mediagoblin-851df6214ee0332eb45282702524934cdb9ebcf7.zip
Use .first() instead of [0]... thanks elrond :)
Diffstat (limited to 'mediagoblin/db/sql/util.py')
-rw-r--r--mediagoblin/db/sql/util.py7
1 files 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):
"""