'The view orders.views.place_order didn't return an HttpResponse object. It returned None instead

I am new to django and got this error. Can someboody please help me to figure out

Here is my views.py code

def place_order(request, total=0, quantity=0,):
current_user = request.user



if request.method == 'POST':
    form = OrderForm(request.POST)
    if form.is_valid():
        
        data = Order()
        data.user = current_user
        data.first_name = form.cleaned_data['first_name']
        data.last_name = form.cleaned_data['last_name']
        data.phone = form.cleaned_data['phone']
        data.email = form.cleaned_data['email']
        data.address_line_1 = form.cleaned_data['address_line_1']
        data.save()
        return redirect('checkout)
else:
    return redirect('checkout')


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source