@api_endpoint
@ajax_request
@login_required
@has_perm('requires_member')
def get_organizations_users(request):
    body = json.loads(request.body)
    org = Organization.objects.get(pk=body['organization_id'])

    users = []
    for u in org.organizationuser_set.all():
        user = u.user
        users.append({
            'email': user.email,
            'first_name': user.first_name,
            'last_name': user.last_name,
            'user_id': user.pk,
            'role': _get_js_role(u.role_level)
        })

    return {'status': 'success', 'users': users}
Retrieve all users belonging to an org.
dataset/ETHPy150Open buildingenergy/buildingenergy-platform/seed/views/accounts.py/get_organizations_users