def register_view(request, error=False):
    """
    Handles requests to /register

    If it's a post request, that means we're receiving the form data and we
    call the form_submission function to save it and return the appropriate
    page (either the registration page if an error occurs otherwise sends the
    user to the confirmation page).

    Otherwise, just returns the registration page.
    """
    if request.method == 'POST':
        return form_post(request)
    else:
        return form_view(request, {
            'open': Registration.is_open(),
            'error': error
        })
def form_failure(request, error_message):
    return form_view(request, {
        'open': Registration.is_open(),
        'error': error_message
    })