Use correct HTTP error codes
This commit is contained in:
1 parent
105bbd3e96
commit
031ed358f1
1 file changed
+2
-2
@@ -40,12 +40,12 @@ def create_product_listing():
|
||||
price = request.json.get('price')
|
||||
|
||||
if name is None or price is None:
|
||||
return abort(401)
|
||||
return abort(400)
|
||||
|
||||
float_price = float(price)
|
||||
|
||||
if not isinstance(float_price, float):
|
||||
return abort(401)
|
||||
return abort(400)
|
||||
|
||||
result, status_code = ProductService.create_listing(user_id, name, float_price)
|
||||
|
||||
|
||||
Reference in new issue
Block a user