Commit de69533a authored by Zac Wood's avatar Zac Wood

Fixed bug where calendar generator would crash for sections without

start or end times
parent f6d25b91
......@@ -11,8 +11,10 @@ class CalendarGeneratorController < ApplicationController
# the intended format for the json is a list of CRNs
params[:_json].each do |crn| # for each CRN sent by the post request
section = CourseSection.find_by_crn(crn)
event = generate_event_from_section(section)
cal.add_event(event)
unless section.start_time == "TBA" || section.end_time == "TBA"
event = generate_event_from_section(section)
cal.add_event(event)
end
end
render plain: cal.to_ical # render a plaintext iCal file
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment