Validate step and go to the next one (or finish the wizard)

    :param transport: Transport object
    :param wizard: Wizard block name
    :param step: Current step number
    :param data: form data for the step

def next(transport, wizard, step, data):
    """
    Validate step and go to the next one (or finish the wizard)

    :param transport: Transport object
    :param wizard: Wizard block name
    :param step: Current step number
    :param data: form data for the step
    """
    step = int(step)
    wizard = blocks.get(wizard)

    # Retrieve form block
    form = wizard.next(step)

    valid = forms.send(transport, form.register_name, data=data)

    if valid:
        if wizard.next(step+1) is None:
            # It was last step
            wizard.finish(transport)
            return

        # Next step
        wizard.step = step+1
        wizard.update(transport)