Fix key package API returning display_name rather than username

This commit is contained in:
rubenwardy 2022-01-12 20:50:01 +00:00
parent e0a92c6455
commit 7ffecbb318
3 changed files with 3 additions and 3 deletions

View File

@ -510,7 +510,7 @@ def all_deps():
} }
page = get_int_or_abort(request.args.get("page"), 1) page = get_int_or_abort(request.args.get("page"), 1)
num = min(get_int_or_abort(request.args.get("n"), 100), 100) num = min(get_int_or_abort(request.args.get("n"), 100), 300)
pagination: flask_sqlalchemy.Pagination = query.paginate(page, num, True) pagination: flask_sqlalchemy.Pagination = query.paginate(page, num, True)
return jsonify({ return jsonify({
"page": pagination.page, "page": pagination.page,

View File

@ -95,7 +95,7 @@ Tokens can be attained by visiting [Settings > API Tokens](/user/tokens/).
* GET `/api/dependencies/` * GET `/api/dependencies/`
* Returns `provides` and raw dependencies for all packages. * Returns `provides` and raw dependencies for all packages.
* Supports [Package Queries](#package-queries) * Supports [Package Queries](#package-queries)
* [Paginated result](#paginated-results), max 100 results per page * [Paginated result](#paginated-results), max 300 results per page
* Each item in `items` will be a dictionary with the following keys: * Each item in `items` will be a dictionary with the following keys:
* `type`: One of `GAME`, `MOD`, `TXP`. * `type`: One of `GAME`, `MOD`, `TXP`.
* `author`: Username of the package author. * `author`: Username of the package author.

View File

@ -453,7 +453,7 @@ class Package(db.Model):
def getAsDictionaryKey(self): def getAsDictionaryKey(self):
return { return {
"name": self.name, "name": self.name,
"author": self.author.display_name, "author": self.author.username,
"type": self.type.toName(), "type": self.type.toName(),
} }