MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / getUser

Function getUser

src/octoprint/server/api/users.py:55–66  ·  view source on GitHub ↗
(username)

Source from the content-addressed store, hash-verified

53@api.route("/users/<username>", methods=["GET"])
54@restricted_access
55def getUser(username):
56 if userManager is None:
57 return jsonify(SUCCESS)
58
59 if current_user is not None and not current_user.is_anonymous and (current_user.get_name() == username or current_user.is_admin()):
60 user = userManager.findUser(username)
61 if user is not None:
62 return jsonify(user.asDict())
63 else:
64 abort(404)
65 else:
66 abort(403)
67
68
69@api.route("/users/<username>", methods=["PUT"])

Callers

nothing calls this directly

Calls 4

is_adminMethod · 0.80
asDictMethod · 0.80
get_nameMethod · 0.45
findUserMethod · 0.45

Tested by

no test coverage detected