nagasurendra commited on
Commit
9f2c95d
·
verified ·
1 Parent(s): d901af3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -6
app.py CHANGED
@@ -211,12 +211,21 @@ def combined_summary():
211
  "fun_facts": menu_item['Ingredient_2__r']['Fun_Facts__c'] or ""
212
  })
213
 
214
- order_items.append({
215
- "name": item_name,
216
- "price": menu_item.get("Price__c"),
217
- "image_url": menu_item.get("Image1__c"),
218
- "ingredients": ingredients
219
- })
 
 
 
 
 
 
 
 
 
220
 
221
  return render_template(
222
  'combined_summary.html',
@@ -230,6 +239,7 @@ def combined_summary():
230
  order_items=order_items
231
  )
232
 
 
233
  except Exception as e:
234
  return f"Error: {str(e)}", 500
235
 
 
211
  "fun_facts": menu_item['Ingredient_2__r']['Fun_Facts__c'] or ""
212
  })
213
 
214
+ # Only add the "Show Ingredients" section if ingredients are present
215
+ if ingredients:
216
+ order_items.append({
217
+ "name": item_name,
218
+ "price": menu_item.get("Price__c"),
219
+ "image_url": menu_item.get("Image1__c"),
220
+ "ingredients": ingredients
221
+ })
222
+ else:
223
+ order_items.append({
224
+ "name": item_name,
225
+ "price": menu_item.get("Price__c"),
226
+ "image_url": menu_item.get("Image1__c"),
227
+ "ingredients": None
228
+ })
229
 
230
  return render_template(
231
  'combined_summary.html',
 
239
  order_items=order_items
240
  )
241
 
242
+
243
  except Exception as e:
244
  return f"Error: {str(e)}", 500
245