Improve .one() by using sqlalchemy's .one()
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Sat, 24 Dec 2011 17:19:40 +0000 (18:19 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Sat, 24 Dec 2011 18:11:42 +0000 (19:11 +0100)
mediagoblin/db/sql/base.py

index 38b043345db604093373a49e069e62f58ab18e6b..5e420bdc43856c39f43fd08a572695c2ad5a023b 100644 (file)
@@ -24,6 +24,4 @@ class GMGTableBase(object):
 
     @classmethod
     def one(cls, query_dict):
-        retval = cls.find_one(query_dict)
-        assert retval is not None
-        return retval
+        return cls.find(query_dict).one()