fixed: create new priceslot
This commit is contained in:
parent
aef5cdd348
commit
79a5630c7e
1 changed files with 10 additions and 2 deletions
12
main.py
12
main.py
|
|
@ -527,7 +527,7 @@ def redis_message_handler():
|
||||||
if (option and option == "PriceSlot"):
|
if (option and option == "PriceSlot"):
|
||||||
handle_get_price_slot(country, user_id)
|
handle_get_price_slot(country, user_id)
|
||||||
else:
|
else:
|
||||||
if not (content):
|
if not (content) and option != "All":
|
||||||
raise Exception (f"[{SERVICE_NAME}] Missing required parameters | Channel: {channel}")
|
raise Exception (f"[{SERVICE_NAME}] Missing required parameters | Channel: {channel}")
|
||||||
|
|
||||||
handle_get_price(country, user_id, content)
|
handle_get_price(country, user_id, content)
|
||||||
|
|
@ -1749,8 +1749,16 @@ def handle_get_price(country: str, user_id: str, content: list):
|
||||||
header = [c.get("fields", {}).get("label", "") for c in sorted_cols]
|
header = [c.get("fields", {}).get("label", "") for c in sorted_cols]
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
|
content_items = content
|
||||||
|
|
||||||
|
if not content_items:
|
||||||
|
content_items = []
|
||||||
|
for row_obj in price_data:
|
||||||
|
row = row_obj["fields"]
|
||||||
|
if len(row) > 0 and str(row[0]).strip():
|
||||||
|
content_items.append({"product_code": str(row[0]).strip()})
|
||||||
|
|
||||||
for item in content:
|
for item in content_items:
|
||||||
product_code = item.get("product_code", "").strip()
|
product_code = item.get("product_code", "").strip()
|
||||||
if not product_code:
|
if not product_code:
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue