Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
from flask import Flask, render_template, send_from_directory, request, jsonify
|
| 2 |
-
from simple_salesforce
|
| 3 |
from dotenv import load_dotenv
|
| 4 |
import os
|
| 5 |
|
|
@@ -15,7 +15,7 @@ def get_salesforce_connection():
|
|
| 15 |
username=os.getenv('SFDC_USERNAME'),
|
| 16 |
password=os.getenv('SFDC_PASSWORD'),
|
| 17 |
security_token=os.getenv('SFDC_SECURITY_TOKEN'),
|
| 18 |
-
domain=os.getenv('SFDC_DOMAIN', 'login')
|
| 19 |
)
|
| 20 |
return sf
|
| 21 |
except Exception as e:
|
|
@@ -49,7 +49,7 @@ def get_ingredients():
|
|
| 49 |
elif dietary_preference == 'non-vegetarian':
|
| 50 |
soql = "SELECT Sector_Detail_Name__c FROM Sector_Detail__c WHERE Category__c IN ('Non-Veg', 'Both') LIMIT 200"
|
| 51 |
else:
|
| 52 |
-
soql = "SELECT Sector_Detail_Name__c FROM Sector_Detail__c LIMIT 200"
|
| 53 |
|
| 54 |
try:
|
| 55 |
result = sf.query(soql)
|
|
|
|
| 1 |
from flask import Flask, render_template, send_from_directory, request, jsonify
|
| 2 |
+
from simple_salesforce import Salesforce
|
| 3 |
from dotenv import load_dotenv
|
| 4 |
import os
|
| 5 |
|
|
|
|
| 15 |
username=os.getenv('SFDC_USERNAME'),
|
| 16 |
password=os.getenv('SFDC_PASSWORD'),
|
| 17 |
security_token=os.getenv('SFDC_SECURITY_TOKEN'),
|
| 18 |
+
domain=os.getenv('SFDC_DOMAIN', 'login')
|
| 19 |
)
|
| 20 |
return sf
|
| 21 |
except Exception as e:
|
|
|
|
| 49 |
elif dietary_preference == 'non-vegetarian':
|
| 50 |
soql = "SELECT Sector_Detail_Name__c FROM Sector_Detail__c WHERE Category__c IN ('Non-Veg', 'Both') LIMIT 200"
|
| 51 |
else:
|
| 52 |
+
soql = "SELECT Sector_Detail_Name__c FROM Sector_Detail__c LIMIT 200"
|
| 53 |
|
| 54 |
try:
|
| 55 |
result = sf.query(soql)
|