srinuksv commited on
Commit
6b938ab
1 Parent(s): ca7d12d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -34,11 +34,7 @@ password = os.getenv("password")
34
  security_token = os.getenv("security_token")
35
  domain = os.getenv("domain")# Using sandbox environment
36
 
37
- # Log in to Salesforce
38
- session_id, sf_instance = SalesforceLogin(username=username, password=password, security_token=security_token, domain=domain)
39
 
40
- # Create Salesforce object
41
- sf = Salesforce(instance=sf_instance, session_id=session_id)
42
  app = FastAPI()
43
 
44
 
@@ -188,7 +184,11 @@ async def save_chat_history(history: dict):
188
  @app.post("/webhook")
189
  async def receive_form_data(request: Request):
190
  form_data = await request.json()
191
-
 
 
 
 
192
  first_name, last_name = split_name(form_data['name'])
193
  data = {
194
  'FirstName': first_name,
 
34
  security_token = os.getenv("security_token")
35
  domain = os.getenv("domain")# Using sandbox environment
36
 
 
 
37
 
 
 
38
  app = FastAPI()
39
 
40
 
 
184
  @app.post("/webhook")
185
  async def receive_form_data(request: Request):
186
  form_data = await request.json()
187
+ # Log in to Salesforce
188
+ session_id, sf_instance = SalesforceLogin(username=username, password=password, security_token=security_token, domain=domain)
189
+
190
+ # Create Salesforce object
191
+ sf = Salesforce(instance=sf_instance, session_id=session_id)
192
  first_name, last_name = split_name(form_data['name'])
193
  data = {
194
  'FirstName': first_name,