Change not found item to return 404 not 500
This commit is contained in:
parent
2e65cb7407
commit
282c904088
@ -34,6 +34,8 @@ def view_inventory_view(item_id):
|
|||||||
user = read_user()
|
user = read_user()
|
||||||
template = "inventory_view.html"
|
template = "inventory_view.html"
|
||||||
item = db.inventory.find_one({ "_id": ObjectId(item_id) })
|
item = db.inventory.find_one({ "_id": ObjectId(item_id) })
|
||||||
|
if not item:
|
||||||
|
return abort(404)
|
||||||
item_user = item.get("inventory", {}).get("user", {}).get("username", None)
|
item_user = item.get("inventory", {}).get("user", {}).get("username", None)
|
||||||
if not user:
|
if not user:
|
||||||
if not item["inventory"].get("public"):
|
if not item["inventory"].get("public"):
|
||||||
|
Loading…
Reference in New Issue
Block a user