From 2d33ee16029d1cc3bacf7919a2337058b64db180 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Sat, 16 Jul 2016 23:09:15 -0400 Subject: [PATCH] Simplify this. The code is equivalent. --- rida/database.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/rida/database.py b/rida/database.py index 6805ed3d..9053eb8d 100644 --- a/rida/database.py +++ b/rida/database.py @@ -199,12 +199,8 @@ class ModuleBuild(Base): count = query.count() if count > 1: raise RuntimeError("%r module builds in flight for %r" % (count, koji_tag)) - elif count == 0: - # No builds in flight scheduled by us. Just ignore this. - return None - # Otherwise, there is exactly one module build - it must be ours. - return query.one() + return query.first() def json(self): return {