def index(request):

    sessionstore.set_customer(request, None)
    sessionstore.set_offer(request, None)
    sessionstore.set_request(request, None)

    return render_to_response('index.html', {
        }, context_instance=RequestContext(request))
def enter_request(request):

    name = request.POST['name']

    try:
        customer = creditapprovalclient.getCustomerByName(name)
        customer = ratingclient.setRating(customer)
        sessionstore.set_customer(request, customer)

    except Exception as e:
        messages.error(request, e)
        return HttpResponseRedirect(request.META['HTTP_REFERER'])

    return render_to_response('enter-request.html', {
            'customer': customer,
            'target': 'create-request',
        }, context_instance=RequestContext(request))