Skip to content

Commit 0a6545f

Browse files
committed
removed unnecessary organization_id from simple salesforce configuration, cleaned up some unused variables
1 parent 6f09685 commit 0a6545f

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

src/server/api/API_ingest/salesforce_contacts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def store_contacts_all():
1616
session.execute("TRUNCATE TABLE salesforcecontacts")
1717

1818
logger.debug("retrieving the latest salesforce contacts data")
19-
sf = Salesforce(domain=os.getenv('SALESFORCE_DOMAIN'), password=os.getenv('SALESFORCE_PW'), username=os.getenv('SALESFORCE_USERNAME'), organizationId=os.getenv('SALESFORCE_ORGANIZATION_ID'), security_token=os.getenv('SALESFORCE_SECURITY_TOKEN'))
19+
sf = Salesforce(domain=os.getenv('SALESFORCE_DOMAIN'), password=os.getenv('SALESFORCE_PW'), username=os.getenv('SALESFORCE_USERNAME'), security_token=os.getenv('SALESFORCE_SECURITY_TOKEN'))
2020
results = sf.query("SELECT Contact_ID_18__c, FirstName, LastName, Contact.Account.Name, MailingCountry, MailingStreet, MailingCity, MailingState, MailingPostalCode, Phone, MobilePhone, Email FROM Contact")
2121
done = False
2222
while not done:

src/server/api/API_ingest/shelterluv_db.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,9 @@ def truncate_animals():
4545

4646
Session = sessionmaker(engine)
4747
session = Session()
48-
metadata = MetaData()
49-
sla = Table("shelterluv_animals", metadata, autoload=True, autoload_with=engine)
5048

5149
truncate = "TRUNCATE table shelterluv_animals;"
52-
result = session.execute(truncate)
50+
session.execute(truncate)
5351

5452
session.commit() # Commit all inserted rows
5553
session.close()
@@ -62,21 +60,15 @@ def truncate_events():
6260

6361
Session = sessionmaker(engine)
6462
with Session() as session:
65-
metadata = MetaData()
66-
sla = Table("sl_animal_events", metadata, autoload=True, autoload_with=engine)
67-
6863
truncate = "TRUNCATE table sl_animal_events;"
69-
result = session.execute(truncate)
64+
session.execute(truncate)
7065
session.commit()
7166

7267
return 0
7368

7469
def insert_events(event_list):
7570
"""Insert event records into sl_animal_events table and return row count. """
7671

77-
offset = 0
78-
has_more = True
79-
8072
# Always a clean insert
8173
truncate_events()
8274

0 commit comments

Comments
 (0)