From 73a7d9dc8bdfd5dd9a6db93efd7522f59cdb984c Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 14 Sep 2019 12:48:19 +0530 Subject: [PATCH] Add uuid to identify products --- ucloud-pay.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ucloud-pay.py b/ucloud-pay.py index 874f8b0..d9e6c72 100644 --- a/ucloud-pay.py +++ b/ucloud-pay.py @@ -9,6 +9,7 @@ from pyotp import TOTP from config import etcd_client as client, logging, APP_PORT from stripe_utils import StripeUtils +from uuid import uuid4 app = Flask(__name__) api = Api(app) @@ -59,7 +60,8 @@ class AddProduct(Resource): return {"message": "Wrong Credentials"}, 403 try: - product_key = "/v1/products/" + product_uuid = uuid4().hex + product_key = "/v1/products/{}".format(product_uuid) product_value = { "name": data["product_name"], "description": data["product_description"],