Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I keep getting Attribute Error
'NoneType' object has no attribute 'get'
It points to: order_number = response.get('order_number',0)
order_number = response.get('order_number',0)
Here are the related files in my checkout app.
checkout
Your function def process(request) returns nothing. So response is always None. It should return a response.
def process(request)
None
Add a comment
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
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.