mirror of https://gitlab.com/litecord/litecord.git
admin_api.users: allow PUT method to create user
PUT was the wanted method. POST serves as a fallback. closes !56
This commit is contained in:
parent
d2e219a1df
commit
9998092db4
|
|
@ -35,14 +35,11 @@ from litecord.common.users import (
|
||||||
bp = Blueprint("users_admin", __name__)
|
bp = Blueprint("users_admin", __name__)
|
||||||
|
|
||||||
|
|
||||||
@bp.route("", methods=["POST"])
|
@bp.route("", methods=["POST", "PUT"])
|
||||||
async def _create_user():
|
async def _create_user():
|
||||||
await admin_check()
|
await admin_check()
|
||||||
|
|
||||||
j = validate(await request.get_json(), USER_CREATE)
|
j = validate(await request.get_json(), USER_CREATE)
|
||||||
|
|
||||||
user_id, _ = await create_user(j["username"], j["email"], j["password"])
|
user_id, _ = await create_user(j["username"], j["email"], j["password"])
|
||||||
|
|
||||||
return jsonify(await app.storage.get_user(user_id))
|
return jsonify(await app.storage.get_user(user_id))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue