aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2020-06-05 04:46:46 +0100
committerrubenwardy <rw@rubenwardy.com>2020-06-05 04:47:50 +0100
commit66885fedaadf6f19de726cf93f1b01364c80a0ea (patch)
tree733ca9d17003b6fd4d5bdde86206636349515017
parent064eb9df0442fa012d3692208cd2579ab3c6caa3 (diff)
downloadcheatdb-66885fedaadf6f19de726cf93f1b01364c80a0ea.tar.xz
Fix bugs, and document
-rw-r--r--app/blueprints/api/endpoints.py4
-rw-r--r--app/flatpages/help/api.md2
2 files changed, 4 insertions, 2 deletions
diff --git a/app/blueprints/api/endpoints.py b/app/blueprints/api/endpoints.py
index 051716b..8ac6e70 100644
--- a/app/blueprints/api/endpoints.py
+++ b/app/blueprints/api/endpoints.py
@@ -58,10 +58,10 @@ def package(package):
def package_dependencies(package):
ret = []
- include_optional = request.args.get("include_optional", True)
+ only_hard = request.args.get("only_hard", True)
for dep in package.dependencies:
- if not include_optional and dep.option:
+ if only_hard and dep.optional:
continue
name = None
diff --git a/app/flatpages/help/api.md b/app/flatpages/help/api.md
index b032b5d..ab5e71c 100644
--- a/app/flatpages/help/api.md
+++ b/app/flatpages/help/api.md
@@ -25,6 +25,8 @@ Tokens can be attained by visiting [Profile > "API Tokens"](/user/tokens/).
* GET `/api/packages/` - See [Package Queries](#package-queries)
* GET `/api/scores/` - See [Package Queries](#package-queries)
* GET `/api/packages/<username>/<name>/`
+* GET `/api/packages/<username>/<name>/`
+ * If query argument `only_hard` is present, only hard deps will be returned.
### Releases