Add user info API

This commit is contained in:
rubenwardy
2022-11-09 20:43:31 +00:00
parent b370b3bab2
commit 1f40a5bf8b
3 changed files with 72 additions and 13 deletions

View File

@@ -578,6 +578,16 @@ def all_deps():
})
@bp.route("/api/users/<username>/")
@cors_allowed
def user_view(username: str):
user = User.query.filter_by(username=username).first()
if user is None:
error(404, "User not found")
return jsonify(user.get_dict())
@bp.route("/api/users/<username>/stats/")
@cors_allowed
def user_stats(username: str):