geethareddy commited on
Commit
ac72660
·
verified ·
1 Parent(s): 238c3dd

Update menu.py

Browse files
Files changed (1) hide show
  1. menu.py +4 -2
menu.py CHANGED
@@ -1,4 +1,5 @@
1
  from flask import Blueprint, render_template, request, session, jsonify
 
2
  from salesforce import get_salesforce_connection
3
 
4
  menu_blueprint = Blueprint('menu', __name__)
@@ -37,7 +38,7 @@ def menu():
37
  referral_code = user_result['records'][0].get('Referral__c', 'N/A')
38
  reward_points = user_result['records'][0].get('Reward_Points__c', 0)
39
 
40
- # Query to fetch Menu_Item__c records including Video URL field
41
  menu_query = """
42
  SELECT Name, Price__c, Description__c, Image1__c, Image2__c, Veg_NonVeg__c, Section__c, Total_Ordered__c, Video_URL__c
43
  FROM Menu_Item__c
@@ -69,5 +70,6 @@ def menu():
69
  )
70
 
71
  except Exception as e:
 
72
  print(f"Error fetching menu data: {str(e)}")
73
- return render_template("error.html", error=str(e))
 
1
  from flask import Blueprint, render_template, request, session, jsonify
2
+ from flask import redirect, url_for
3
  from salesforce import get_salesforce_connection
4
 
5
  menu_blueprint = Blueprint('menu', __name__)
 
38
  referral_code = user_result['records'][0].get('Referral__c', 'N/A')
39
  reward_points = user_result['records'][0].get('Reward_Points__c', 0)
40
 
41
+ # Query to fetch Menu_Item__c records including Total_Ordered__c for best sellers
42
  menu_query = """
43
  SELECT Name, Price__c, Description__c, Image1__c, Image2__c, Veg_NonVeg__c, Section__c, Total_Ordered__c, Video_URL__c
44
  FROM Menu_Item__c
 
70
  )
71
 
72
  except Exception as e:
73
+ # Log the error and return the error page with error details
74
  print(f"Error fetching menu data: {str(e)}")
75
+ return render_template("error.html", error=str(e)) # Render error.html with the error message