Added condition to check for existing splashpage. Will redirect user if splashpage is not found.

This commit is contained in:
Marie-Elise 2018-01-13 22:40:42 -06:00 committed by James Mason
parent e3b83e8ec1
commit 34af9b840b

View file

@ -20,6 +20,9 @@ class ConferencesController < ApplicationController
authorize! :show, @conference # TODO: reduce the 10 queries performed here authorize! :show, @conference # TODO: reduce the 10 queries performed here
splashpage = @conference.splashpage splashpage = @conference.splashpage
if !splashpage.present?
redirect_to admin_conference_splashpage_path(@conference.short_title)
else
if splashpage.include_cfp if splashpage.include_cfp
cfps = @conference.program.cfps cfps = @conference.program.cfps
@call_for_events = cfps.find { |call| call.cfp_type == 'events' } @call_for_events = cfps.find { |call| call.cfp_type == 'events' }
@ -52,6 +55,7 @@ class ConferencesController < ApplicationController
).order('sponsorship_levels.position ASC', 'sponsors.name') ).order('sponsorship_levels.position ASC', 'sponsors.name')
end end
end end
end
private private