diff --git a/main.py b/main.py index 3442998..ea55c19 100644 --- a/main.py +++ b/main.py @@ -527,7 +527,7 @@ def redis_message_handler(): if (option and option == "PriceSlot"): handle_get_price_slot(country, user_id) else: - if not (content): + if not (content) and option != "All": raise Exception (f"[{SERVICE_NAME}] Missing required parameters | Channel: {channel}") 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] 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() if not product_code: continue