Skip to content

Commit 5263990

Browse files
committed
fix(indico_ingestor): presence, stderr
1 parent 19fe8c2 commit 5263990

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

app/controllers/events_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def event_params
236236
:timezone, :content_provider_id, { collection_ids: [] }, { node_ids: [] },
237237
{ node_names: [] }, { target_audience: [] }, { eligibility: [] }, :visible,
238238
{ host_institutions: [] }, :capacity, :contact, :recognition, :learning_objectives,
239-
:prerequisites, :tech_requirements, :cost_basis, :cost_value, :cost_currency, :language,
239+
:prerequisites, :tech_requirements, :cost_basis, :cost_value, :cost_currency, :language, :presence,
240240
external_resources_attributes: %i[id url title _destroy],
241241
external_resources: %i[url title], material_ids: [],
242242
llm_interaction_attributes: %i[id scrape_or_process model prompt input output needs_processing _destroy],

lib/ingestors/indico_ingestor.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ def process_calevent(calevent)
9494
event_to_add = OpenStruct.new.tap do |event|
9595
assign_basic_info(event, calevent)
9696
assign_time_info(event, calevent)
97-
assign_location_info(event, calevent.location)
97+
assign_location_info(event, calevent)
9898
end
9999
add_event(event_to_add)
100100
rescue StandardError => e
101-
@messages << "process_calevent failed with: #{e.message}"
101+
Rails.logger.error("#{e.class}: #{e.message}")
102102
end
103103

104104
# Assigns to event: url, title, description, keywords.
@@ -118,11 +118,13 @@ def assign_time_info(event, calevent)
118118
end
119119

120120
# Assigns to event: venue, online, city.
121-
def assign_location_info(event, location)
121+
def assign_location_info(event, calevent)
122+
location = calevent.location
122123
return if location.blank?
123124

124125
event.venue = location.to_s
125-
event.online = location.downcase.include?('online')
126+
event.online = calevent.description.include?('zoom')
127+
event.presence = calevent.description.include?('zoom') ? :hybrid : :onsite # can do best, but sufficient for now
126128
event.city, event.postcode, event.country = process_location(location)
127129
end
128130

0 commit comments

Comments
 (0)