Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blake #3

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def handle_webhook():
logging.error("No data received in request")
return make_response(jsonify({"error": "No data received"}), 400)

data = data['data']
if data.get('toStageId') != os.getenv('VideoStageId'):
logging.error("Invalid credentials submitted in request.")
return make_response(jsonify({"error": "Invalid credentials submitted."}), 403)
Expand Down Expand Up @@ -118,9 +119,10 @@ def handle_webhook():
# Assuming post_candidate_analysis_to_lever returns None on failure
logging.error(f"Failed to send results to Lever for opportunityId {opportunity_id}")
return make_response(jsonify({"error": "Failed to send results to Lever"}), 500)

print('done')
return jsonify(analysis_result), 200
except Exception as e:
print(e)
logging.error(f"An unexpected error occurred: {e}")
return make_response(jsonify({"error": "An unexpected error occurred"}), 500)

Expand Down
Loading