def resend_confirmation():
    """View for resending an email confirmation email.
    """
    form = ResendConfirmationForm(request.form)
    if request.method == 'POST':
        if form.validate():
            clean_email = form.email.data
            user = get_user(email=clean_email)
            if not user:
                return {'form': form}
            try:
                send_confirm_email(user, clean_email)
            except __HOLE__:  # already confirmed, redirect to dashboard
                status_message = 'Email has already been confirmed.'
                kind = 'warning'
            else:
                status_message = 'Resent email to {0}'.format(clean_email)
                kind = 'success'
            status.push_status_message(status_message, kind=kind, trust=False)
        else:
            forms.push_errors_to_status(form.errors)
    # Don't go anywhere
    return {'form': form}


# TODO: shrink me
dataset/ETHPy150Open CenterForOpenScience/osf.io/framework/auth/views.py/resend_confirmation