Correct product_id
It was containing the entire dir /v1/...
This commit is contained in:
parent
dd5da3b234
commit
3dab0efcd6
1 changed files with 2 additions and 2 deletions
|
@ -110,7 +110,7 @@ class AddProduct(Resource):
|
|||
product_uuid = uuid4().hex
|
||||
product_key = "/v1/products/{}".format(product_uuid)
|
||||
product_value = {
|
||||
"product_id": product_key,
|
||||
"product_id": product_uuid,
|
||||
"name": data["product_name"],
|
||||
"description": data["product_description"],
|
||||
"type": data["product_type"],
|
||||
|
@ -126,7 +126,7 @@ class AddProduct(Resource):
|
|||
client.put(product_key, product_value, value_in_json=True)
|
||||
return {"message":
|
||||
"Product {} created. Product ID = {}".format(
|
||||
data['product_name'], product_key
|
||||
data['product_name'], product_uuid
|
||||
)}, 200
|
||||
except KeyError as ke:
|
||||
logging.error("KeyError occurred. details = {}".format(str(ke)))
|
||||
|
|
Loading…
Reference in a new issue