선풍기
선풍기

Reputation: 961

Django AttributeError

I keep getting Attribute Error

'NoneType' object has no attribute 'get'

It points to: order_number = response.get('order_number',0)

Here are the related files in my checkout app.

Upvotes: 0

Views: 69

Answers (2)

Exprator
Exprator

Reputation: 27503

change your process function to this

def process(request):
    order = create_order(request)
    results = {'order_number':order.id,'message':''}
    postdata = request.POST.copy()
    amount = cart.cart_subtotal(request)
    return results

Upvotes: 1

Nadège
Nadège

Reputation: 931

Your function def process(request) returns nothing. So response is always None. It should return a response.

Upvotes: 2

Related Questions