mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
fix access denied error for program in custom domains
This commit is contained in:
parent
0ac5d18ef2
commit
f4775f8e6a
1 changed files with 3 additions and 3 deletions
|
|
@ -2,7 +2,6 @@ class ConferencesController < ApplicationController
|
|||
protect_from_forgery with: :null_session
|
||||
before_action :respond_to_options
|
||||
load_and_authorize_resource find_by: :short_title
|
||||
load_resource :program, through: :conference, singleton: true, except: :index
|
||||
|
||||
def index
|
||||
@current = Conference.where('end_date >= ?', Date.current).reorder(start_date: :asc)
|
||||
|
|
@ -10,14 +9,15 @@ class ConferencesController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
# have to change "localhost" to ENV['OSEM_HOSTNAME'] in production
|
||||
# have to change "localhost" to ENV['OSEM_HOSTNAME'] in production
|
||||
check_custom_domain if request.host != 'localhost'
|
||||
@program = @conference.program
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def check_custom_domain
|
||||
@conference = @conference.custom_domain.present? ? Conference.find_by(custom_domain: request.domain) : @conference
|
||||
@conference = @conference.nil? ? Conference.find_by(custom_domain: request.domain) : @conference
|
||||
end
|
||||
|
||||
def respond_to_options
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue