Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Highfire1 committed Nov 30, 2024
1 parent 59ce020 commit 02b6fb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdk/fetch_execs.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ def updateDataFromNotion(writeLocation="data/"):


# Check for deleted executives in cached data
cached_event_ids = {exec.student_id for exec in local_data}
cached_event_ids = {exec["student_id"] for exec in local_data if "student_id" in exec}
current_event_ids = {page["id"] for page in exec_pages["results"]}
deleted_event_ids = cached_event_ids - current_event_ids
# Remove deleted executives from cached data and delete associated images
for student_id in deleted_event_ids:
# Remove executive from cached data
local_data = [exec for exec in local_data if exec.student_id != student_id]
local_data = [exec for exec in local_data if exec["student_id"] != student_id]
# Delete associated image if it exists
image_path = f"{writeLocation}/exec_images/{student_id}.*" # Adjusted to use writeLocation
for ext in ['webp', 'jpg', 'png', 'jpeg', 'gif']:
Expand Down

0 comments on commit 02b6fb8

Please sign in to comment.