Commit de69533a authored by Zac Wood's avatar Zac Wood
Browse files

Fixed bug where calendar generator would crash for sections without

start or end times
parent f6d25b91
Pipeline #2740 passed with stage
in 2 minutes and 7 seconds
......@@ -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)
unless section.start_time == "TBA" || section.end_time == "TBA"
event = generate_event_from_section(section)
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