Skip to content
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
10 changes: 6 additions & 4 deletions tools/automation_prepare_adhoc_availability.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,19 @@ def update_mentor_availability(month, xlsx_file_path, yml_file_path):
mentor['availability'] = []
continue

# otherwise: mentor is available, update sort and reset availability to the current month only
current_availability = mentor.get('availability', [])
mentor['sort'] = get_available_mentor_sort(mentor, current_availability)
mentor['availability'] = [month]
# otherwise: mentor is available

# Only update hours if updated hours is not None
updated_hours = availability_updates.get(yml_name)
if updated_hours is not None:
logging.info(f"Updating hours for {yml_name} to: {updated_hours}")
mentor['hours'] = updated_hours

# update sort and reset availability to the current month only
current_availability = mentor.get('availability', [])
mentor['sort'] = get_available_mentor_sort(mentor, current_availability)
mentor['availability'] = [month]

with open(yml_file_path, 'w') as f:
yaml.default_flow_style = True
yaml.dump(mentors, f)
Expand Down