routers.packages: Simplify some existence checks

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-08-06 00:59:38 -07:00
parent bace345da4
commit 4ade8b0539
6 changed files with 48 additions and 43 deletions

View file

@ -69,4 +69,4 @@ class PackageDependency(Base):
pkg = db.query(Package, Package.Name == self.DepName)
official = db.query(OfficialProvider,
OfficialProvider.Name == self.DepName)
return pkg.count() > 0 or official.count() > 0
return pkg.scalar() or official.scalar()