From 4305580e8538e5523e9f621c3ffbed14a2ddc350 Mon Sep 17 00:00:00 2001 From: Elrond Date: Sat, 24 Dec 2011 18:19:40 +0100 Subject: [PATCH] Improve .one() by using sqlalchemy's .one() --- mediagoblin/db/sql/base.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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() -- 2.25.1