From 22ac971db8f479200d61f9a86aa2a6dbc06b5cdc Mon Sep 17 00:00:00 2001 From: PCoder Date: Thu, 19 Sep 2019 15:50:14 +0530 Subject: [PATCH] Remove email dependency for product --- commands/product.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/commands/product.py b/commands/product.py index 6afd10e..33861d2 100755 --- a/commands/product.py +++ b/commands/product.py @@ -1,7 +1,7 @@ import click import requests - from decouple import config + from .helper import OTPCredentials, load_dump_pretty @@ -28,11 +28,10 @@ def list(): @click.option("--product-price", required=True, help="Price in CHF cents", type=int) @click.option("--product-recurring-period", required=False, - help="Only used for products with recurring costs", - type=int) + help="Only used for products with recurring costs") @click.option("--product-minimum-subscription-period", required=False, - type=int, help="Minimum period for which a user needs to " - "subscribe the product for", default=0) + help="Minimum period for which a user needs to " + "subscribe the product for") def add(name, realm, seed, product_name, product_description, product_type, product_price, product_recurring_period, product_minimum_subscription_period): @@ -55,14 +54,12 @@ def add(name, realm, seed, product_name, product_description, product_type, @click.option("--name", envvar="OTP_NAME", required=True) @click.option("--realm", envvar="OTP_REALM", required=True) @click.option("--seed", envvar="OTP_SEED", required=True) -@click.option("--email", required=True) @click.option("--product-id", help="The uuid of the product", required=True) -def order(name, realm, seed, product_id, email): +def order(name, realm, seed, product_id): data = { **OTPCredentials(name, realm, seed).get_json(), - "product_id": product_id, - "email": email + "product_id": product_id } r = requests.post("{}/product/order".format(config('UCLOUD_PAY_SERVER')), json=data) - print(load_dump_pretty(r.content)) \ No newline at end of file + print(load_dump_pretty(r.content))