def post(self, request, group_id):
    '\n        Bulk add group members.\n\n        Permission checking:\n        1. only admin can perform this action.\n        '
    if (not request.user.admin_permissions.can_manage_group()):
        return api_error(status.HTTP_403_FORBIDDEN, 'Permission denied.')
    group_id = int(group_id)
    group = ccnet_api.get_group(group_id)
    if (not group):
        error_msg = ('Group %d not found.' % group_id)
        return api_error(status.HTTP_404_NOT_FOUND, error_msg)
    emails = request.POST.getlist('email', '')
    if (not emails):
        error_msg = 'Email invalid.'
        return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
    result = {}
    result['failed'] = []
    result['success'] = []
    emails_need_add = []
    for email in emails:
        try:
            User.objects.get(email=email)
        except User.DoesNotExist:
            result['failed'].append({'email': email, 'error_msg': ('User %s not found.' % email)})
            continue
        if is_group_member(group_id, email, in_structure=False):
            result['failed'].append({'email': email, 'error_msg': ('User %s is already a group member.' % email2nickname(email))})
            continue
        emails_need_add.append(email)
    for email in emails_need_add:
        try:
            ccnet_api.group_add_member(group_id, group.creator_name, email)
            member_info = get_group_member_info(request, group_id, email)
            result['success'].append(member_info)
        except Exception as e:
            logger.error(e)
            result['failed'].append({'email': email, 'error_msg': 'Internal Server Error'})
        add_user_to_group.send(sender=None, group_staff=request.user.username, group_id=group_id, added_user=email)
    return Response(result)
Bulk add group members.

Permission checking:
1. only admin can perform this action.
def post(self, request, group_id):
    '\n        Bulk add group members.\n\n        Permission checking:\n        1. only admin can perform this action.\n        '
    if (not request.user.admin_permissions.can_manage_group()):
        return api_error(status.HTTP_403_FORBIDDEN, 'Permission denied.')
    group_id = int(group_id)
    group = ccnet_api.get_group(group_id)
    if (not group):
        error_msg = ('Group %d not found.' % group_id)
        return api_error(status.HTTP_404_NOT_FOUND, error_msg)
    emails = request.POST.getlist('email', )
    if (not emails):
        error_msg = 'Email invalid.'
        return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
    result = {}
    result['failed'] = []
    result['success'] = []
    emails_need_add = []
    for email in emails:
        try:
            User.objects.get(email=email)
        except User.DoesNotExist:
            result['failed'].append({'email': email, 'error_msg': ('User %s not found.' % email)})
            continue
        if is_group_member(group_id, email, in_structure=False):
            result['failed'].append({'email': email, 'error_msg': ('User %s is already a group member.' % email2nickname(email))})
            continue
        emails_need_add.append(email)
    for email in emails_need_add:
        try:
            ccnet_api.group_add_member(group_id, group.creator_name, email)
            member_info = get_group_member_info(request, group_id, email)
            result['success'].append(member_info)
        except Exception as e:
            logger.error(e)
            result['failed'].append({'email': email, 'error_msg': 'Internal Server Error'})
        add_user_to_group.send(sender=None, group_staff=request.user.username, group_id=group_id, added_user=email)
    return Response(result)