Use get instead of get_prefix to obtain the desired product

This commit is contained in:
PCoder 2019-09-14 13:50:00 +05:30
parent a7ba9669f8
commit 97743f1346
1 changed files with 4 additions and 4 deletions

View File

@ -227,14 +227,14 @@ class ProductOrder(Resource):
# Validate the given product is ok
product_id = data["product_id"]
product = client.get_prefix(
"/v1/products/{}/".format(product_id), value_in_json=True
product = client.get(
"/v1/products/{}".format(product_id), value_in_json=True
)
if not product:
logging.debug("User chose invalid product {}".format(product))
logging.debug("User chose invalid product {}".format(product_id))
return {"message": "Invalid product"}, 400
logging.debug("Got product {}".format(str(product)))
logging.debug("Got product {}: {}".format(product.key, product.value))
# Check the user has a payment source added