Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,17 +28,16 @@ from simple_salesforce import Salesforce, SalesforceAuthenticationFailed
|
|
| 28 |
SF_USERNAME = os.getenv("SF_USERNAME")
|
| 29 |
SF_PASSWORD = os.getenv("SF_PASSWORD")
|
| 30 |
SF_SECURITY_TOKEN = os.getenv("SF_SECURITY_TOKEN")
|
| 31 |
-
SF_DOMAIN = os.getenv("SF_DOMAIN") or "login" # default to 'login' for production
|
| 32 |
|
| 33 |
-
print(f"Salesforce login info: username={SF_USERNAME}
|
| 34 |
|
| 35 |
# Salesforce connection with error handling
|
| 36 |
try:
|
|
|
|
| 37 |
sf = Salesforce(
|
| 38 |
username=SF_USERNAME,
|
| 39 |
password=SF_PASSWORD,
|
| 40 |
-
security_token=SF_SECURITY_TOKEN
|
| 41 |
-
domain=SF_DOMAIN
|
| 42 |
)
|
| 43 |
print("Salesforce login successful.")
|
| 44 |
except SalesforceAuthenticationFailed as e:
|
|
|
|
| 28 |
SF_USERNAME = os.getenv("SF_USERNAME")
|
| 29 |
SF_PASSWORD = os.getenv("SF_PASSWORD")
|
| 30 |
SF_SECURITY_TOKEN = os.getenv("SF_SECURITY_TOKEN")
|
|
|
|
| 31 |
|
| 32 |
+
print(f"Salesforce login info: username={SF_USERNAME}")
|
| 33 |
|
| 34 |
# Salesforce connection with error handling
|
| 35 |
try:
|
| 36 |
+
# Default domain is "login" (production); use domain="test" for sandbox/Developer Edition orgs
|
| 37 |
sf = Salesforce(
|
| 38 |
username=SF_USERNAME,
|
| 39 |
password=SF_PASSWORD,
|
| 40 |
+
security_token=SF_SECURITY_TOKEN
|
|
|
|
| 41 |
)
|
| 42 |
print("Salesforce login successful.")
|
| 43 |
except SalesforceAuthenticationFailed as e:
|