Skip to content

Commit af4029d

Browse files
committed
add same edit to tutorial002.py
1 parent 4fed048 commit af4029d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs_src/body/tutorial002.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Item(BaseModel):
1717
@app.post("/items/")
1818
async def create_item(item: Item):
1919
item_dict = item.dict()
20-
if item.tax:
20+
if item.tax is not None:
2121
price_with_tax = item.price + item.tax
2222
item_dict.update({"price_with_tax": price_with_tax})
2323
return item_dict

0 commit comments

Comments
 (0)