clubs api endpoint
This commit is contained in:
parent
1e452d10ce
commit
1bc305fe59
|
@ -149,3 +149,11 @@ def delete(group_name):
|
|||
click.confirm(f"Are you sure you want to delete {group_name}?", abort=True)
|
||||
resp = http_delete(f'/api/groups/{group_name}')
|
||||
handle_stream_response(resp, DeleteGroupTransaction.operations)
|
||||
|
||||
@gropus.command(short_help='Search for groups')
|
||||
@click.argument('group name')
|
||||
def search(group_name):
|
||||
check_if_in_development()
|
||||
resp = http_get('/api/groups/clubs')
|
||||
result = handle_sync_response(resp)
|
||||
print(result)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from flask import Blueprint, request
|
||||
from flask.json import jsonify
|
||||
from zope import component
|
||||
|
||||
from .utils import authz_restrict_to_syscom, is_truthy, \
|
||||
|
@ -31,6 +32,12 @@ def get_group(group_name):
|
|||
group = ldap_srv.get_group(group_name)
|
||||
return group.to_dict()
|
||||
|
||||
@bp.route('/clubs')
|
||||
def get_clubs():
|
||||
ldap_srv = component.getUtility(ILDAPService)
|
||||
clubs = ldap_srv.get_clubs()
|
||||
#return jsonify([club.to_dict() for club in clubs])
|
||||
return jsonify(clubs)
|
||||
|
||||
@bp.route('/<group_name>/members/<username>', methods=['POST'])
|
||||
@authz_restrict_to_syscom
|
||||
|
|
Loading…
Reference in New Issue