From: Elrond Date: Sat, 24 Dec 2011 17:19:40 +0000 (+0100) Subject: Improve .one() by using sqlalchemy's .one() X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4305580e8538e5523e9f621c3ffbed14a2ddc350;p=mediagoblin.git Improve .one() by using sqlalchemy's .one() --- diff --git a/mediagoblin/db/sql/base.py b/mediagoblin/db/sql/base.py index 38b04334..5e420bdc 100644 --- a/mediagoblin/db/sql/base.py +++ b/mediagoblin/db/sql/base.py @@ -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()