@decorators.json_view
@account_decorators.login_required
def user_verification(request):
    logger.info(__name__ + ', user_verification (AJAX)')
    for x in request.POST:
        print((x, ':', request.POST[x]))

    if 'user_list' not in request.POST:
        print((__name__ + ', user_verification, raising BadRequest.'))
        raise Exception("'user_list' not found as a POST parameter.")

    value = str(request.POST['user_list'])
    user_list = json.loads(value)

    # noinspection PyProtectedMember
    if site_models.Site._meta.installed:
        # noinspection PyUnusedLocal
        site = site_models.Site.objects.get_current()
    else:
        # noinspection PyUnusedLocal
        site = site_models.RequestSite(request)

    v_users = []

    for user_id in user_list:
    
        # 1) first, the confirmation email is sent
        utils.allauth_confirm_email(
            auth_models.User.objects.get(pk=user_id), request
        )
        # 2) afterwards, the profile is set as verified and saved
        u_profile = get_object_or_404(models.UserProfile, pk=user_id)
        # ### Uncomment when ready ### u_profile.is_verified = True
        u_profile.save()
        # 3) this user_id is added to the list of verified ids to be returned
        v_users.append(user_id)

    j_v_users = json.dumps(v_users)
    result = dict(user_list=j_v_users)
    print((__name__ + ', user_verification, j_v_users = ' + j_v_users))

    return result
Builds the header of a syslog-ng configuration object.
dataset/ETHPy150Open satnet-project/server/services/accounts/ajax.py/user_verification--crossover with--dataset/ETHPy150Open saltstack/salt/salt/modules/syslog_ng.py/Buildable.build_header