Add multiple groups querying
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful
This commit is contained in:
parent
4f12c3efb2
commit
ae54161c60
@ -22,13 +22,13 @@ def view_users():
|
|||||||
print(resp)
|
print(resp)
|
||||||
return jsonify(resp)
|
return jsonify(resp)
|
||||||
|
|
||||||
@page_api.route("/cards")
|
@page_api.route("/cards", methods=["POST"])
|
||||||
def get_group_cards():
|
def get_group_cards():
|
||||||
group = request.args.get("group", False)
|
groups = request.json.get("groups", False)
|
||||||
if not group:
|
if not groups:
|
||||||
return "must specify group in parameter", 400
|
return "must specify groups in parameter", 400
|
||||||
print(group)
|
print(groups)
|
||||||
gu = list(filter(lambda u: any(g["name"] == group for g in u["status"]["groups"]), get_users()))
|
gu = list(filter(lambda u: any(g["name"] in groups for g in u["status"]["groups"]), get_users()))
|
||||||
keys = list(map(lambda u: u["metadata"]["name"], gu))
|
keys = list(map(lambda u: u["metadata"]["name"], gu))
|
||||||
print(keys)
|
print(keys)
|
||||||
flt = {
|
flt = {
|
||||||
|
Loading…
Reference in New Issue
Block a user