Skip to content

Commit

Permalink
Fix schedule term parsing (#134)
Browse files Browse the repository at this point in the history
Parse the correct schedule for each term (the dictionary key was wrong,
so it was defaulting to using 'schedule' instead of e.g.
'schedule_spring').

This fix, in addition to sipb/fireroad-server#57
should fully fix sipb/fireroad-server#56
(checked 18.02A, 21G.301, 21G.401)
  • Loading branch information
snowmonkey18 authored Jan 30, 2025
1 parent 273fa36 commit c2f7ea4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scrapers/fireroad.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,12 @@ def get_course_data(courses, course, term):
# designRawSections
if has_schedule:
try:
if term == Term.FA and "scheduleFall" in course:
raw_class.update(parse_schedule(course["scheduleFall"]))
elif term == Term.JA and "scheduleIAP" in course:
raw_class.update(parse_schedule(course["scheduleIAP"]))
elif term == Term.SP and "scheduleSpring" in course:
raw_class.update(parse_schedule(course["scheduleSpring"]))
if term == Term.FA and "schedule_fall" in course:
raw_class.update(parse_schedule(course["schedule_fall"]))
elif term == Term.JA and "schedule_IAP" in course:
raw_class.update(parse_schedule(course["schedule_IAP"]))
elif term == Term.SP and "schedule_spring" in course:
raw_class.update(parse_schedule(course["schedule_spring"]))
else:
raw_class.update(parse_schedule(course["schedule"]))
except ValueError as val_err:
Expand Down

0 comments on commit c2f7ea4

Please sign in to comment.