aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-04-08 19:30:57 +0100
committerrubenwardy <rw@rubenwardy.com>2018-04-08 19:30:57 +0100
commit1ecc3db3830bcedb1be5094988a5cc4abf6d5c62 (patch)
tree29106ab531bc6f2b26412dae3151a1df7d847c29
parenta6ccb75ffdbc5aa38742d89d0fb4dada01b15442 (diff)
downloadcheatdb-1ecc3db3830bcedb1be5094988a5cc4abf6d5c62.tar.xz
Remove packages with no approved releases from JSON
-rw-r--r--app/views/packages.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/views/packages.py b/app/views/packages.py
index 8165c15..6428339 100644
--- a/app/views/packages.py
+++ b/app/views/packages.py
@@ -28,7 +28,9 @@ def doPackageList(type):
query = query.filter(Package.title.contains(search))
if shouldReturnJson():
- return jsonify([package.getAsDictionary(app.config["BASE_URL"]) for package in query.all()])
+ pkgs = [package.getAsDictionary(app.config["BASE_URL"]) \
+ for package in query.all() if package.getDownloadRelease() is not None]
+ return jsonify(pkgs)
else:
tags = Tag.query.all()
return render_template("packages/list.html", title=title, packages=query.all(), query=search, tags=tags, type=None if type is None else type.toName())