Skip to content

Commit 9295d43

Browse files
authored
Merge pull request #604 from CodeForPhilly/bump-flask-werkzeug
bump deps
2 parents 89813d1 + 468f276 commit 9295d43

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

src/server/api/API_ingest/updated_data.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def get_updated_contact_data():
6161
with Session() as session:
6262
result = session.execute(qry)
6363
sfdata = result.fetchone()[0]
64-
logger.debug(sfdata)
65-
logger.debug("Query for Salesforce update returned %d records", len(sfdata))
66-
return sfdata
64+
if sfdata:
65+
logger.debug(sfdata)
66+
logger.debug("Query for Salesforce update returned %d records", len(sfdata))
67+
return sfdata

src/server/api/internal_api.py

+16-8
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,29 @@ def ingest_raw_data():
4545
def get_contact_data():
4646
logger.debug("Calling get_updated_contact_data()")
4747
contact_json = updated_data.get_updated_contact_data()
48-
logger.debug("Returning %d contact records", len(contact_json))
49-
return jsonify(contact_json), 200
48+
if contact_json:
49+
logger.debug("Returning %d contact records", len(contact_json))
50+
else:
51+
logger.debug("No contact records found")
52+
return jsonify({'outcome': 'OK'}), 200
5053

5154

5255
@internal_api.route("/api/internal/start_flow", methods=["GET"])
5356
def run_flow():
5457
logger.debug("Calling flow_script.start_flow()")
5558
flow_script.start_flow()
5659
logger.debug("Flow processing complete")
57-
return jsonify(''), 200
60+
return jsonify({'outcome': 'OK'}), 200
5861

5962

6063
@internal_api.route("/api/internal/send_salesforce_platform_message", methods=["GET"])
6164
def send_salesforce_platform_message():
6265
contact_list = updated_data.get_updated_contact_data()
63-
logger.debug("Returning %d contact records", len(contact_list))
64-
salesforce_message_publisher.send_pipeline_update_messages(contact_list)
65-
66+
if contact_list:
67+
logger.debug("Returning %d contact records", len(contact_list))
68+
salesforce_message_publisher.send_pipeline_update_messages(contact_list)
69+
else:
70+
logger.debug("No contact records found")
6671
return jsonify({'outcome': 'OK'}), 200
6772

6873
@internal_api.route("/api/internal/full_flow", methods=["GET"])
@@ -73,7 +78,10 @@ def start_flow():
7378
flow_script.start_flow()
7479
logger.info("Building updated data payload")
7580
updated_contacts_list = updated_data.get_updated_contact_data()
76-
logger.info("Sending Salesforce platform messages")
77-
salesforce_message_publisher.send_pipeline_update_messages(updated_contacts_list)
81+
if updated_contacts_list:
82+
logger.info("Sending Salesforce platform messages")
83+
salesforce_message_publisher.send_pipeline_update_messages(updated_contacts_list)
84+
else:
85+
logger.info("No contacts to update")
7886

7987
return jsonify({'outcome': 'OK'}), 200

src/server/requirements.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
Flask==1.1.2
1+
Flask==3.0.1
22
sqlalchemy==1.4.15
33
psycopg2-binary==2.9.1
44
openpyxl
55
requests
66
pytest
7-
flask-jwt-extended==4.0.2
7+
flask-jwt-extended==4.6.0
88
alembic
99
flask-cors
1010
dropbox
1111
jellyfish
1212
networkx
13-
jinja2<3.1.0
14-
itsdangerous==2.0.1 # TODO: upgrade flask so we don't have to do this
13+
Jinja2>=3.1.2
14+
itsdangerous>=2.1.2
1515
simple-salesforce
16-
werkzeug==2.0.3
16+
werkzeug==3.0.1
1717
structlog
1818
pyjwt
1919
cryptography

0 commit comments

Comments
 (0)