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

Function addUser

src/octoprint/server/api/users.py:30–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28@restricted_access
29@admin_permission.require(403)
30def addUser():
31 # if userManager is None:
32 # return jsonify(SUCCESS)
33
34 # if "application/json" in request.headers["Content-Type"]:
35 # data = request.json
36
37 # name = data["name"]
38 # password = data["password"]
39 # active = data["active"]
40
41 # roles = ["user"]
42 # if "admin" in data.keys() and data["admin"]:
43 # roles.append("admin")
44
45 # try:
46 # userManager.addUser(name, password, active, roles)
47 # except users.UserAlreadyExists:
48 # abort(409)
49 # return getUsers()
50 abort(404)
51
52
53@api.route("/users/<username>", methods=["GET"])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected