Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -285,18 +285,18 @@ def menu():
|
|
| 285 |
|
| 286 |
# Filter categories dynamically
|
| 287 |
categories = {item.get("Veg_NonVeg__c").capitalize() for item in food_items if item.get("Veg_NonVeg__c")}
|
| 288 |
-
categories = {"Veg", "Non
|
| 289 |
|
| 290 |
# Filter food items based on the selected category
|
| 291 |
if selected_category == "Veg":
|
| 292 |
food_items = [item for item in food_items if item.get("Veg_NonVeg__c") in ["Veg", "both"]]
|
| 293 |
-
elif selected_category == "Non
|
| 294 |
food_items = [item for item in food_items if item.get("Veg_NonVeg__c") in ["Non veg", "both"]]
|
| 295 |
|
| 296 |
except Exception as e:
|
| 297 |
print(f"Error fetching menu data: {str(e)}")
|
| 298 |
food_items = []
|
| 299 |
-
categories = {"All", "Veg", "Non
|
| 300 |
referral_code = 'N/A'
|
| 301 |
reward_points = 0
|
| 302 |
|
|
|
|
| 285 |
|
| 286 |
# Filter categories dynamically
|
| 287 |
categories = {item.get("Veg_NonVeg__c").capitalize() for item in food_items if item.get("Veg_NonVeg__c")}
|
| 288 |
+
categories = {"Veg", "Non veg"} # Ensure valid categories only
|
| 289 |
|
| 290 |
# Filter food items based on the selected category
|
| 291 |
if selected_category == "Veg":
|
| 292 |
food_items = [item for item in food_items if item.get("Veg_NonVeg__c") in ["Veg", "both"]]
|
| 293 |
+
elif selected_category == "Non veg":
|
| 294 |
food_items = [item for item in food_items if item.get("Veg_NonVeg__c") in ["Non veg", "both"]]
|
| 295 |
|
| 296 |
except Exception as e:
|
| 297 |
print(f"Error fetching menu data: {str(e)}")
|
| 298 |
food_items = []
|
| 299 |
+
categories = {"All", "Veg", "Non veg"} # Default categories on error
|
| 300 |
referral_code = 'N/A'
|
| 301 |
reward_points = 0
|
| 302 |
|