suggested changes

This commit is contained in:
shlok007 2017-06-07 14:14:42 +05:30
parent 949f5cb591
commit b29856a122
2 changed files with 3 additions and 8 deletions

View file

@ -79,12 +79,9 @@ module Admin
end
def create
conference_params_copy = conference_params
if ENV['ORGANIZATIONS_ENABLED'] != 'true'
org = Organization.exists?(name: 'default') ? Organization.find_by(name: 'default') : Organization.create(name: 'default')
conference_params_copy[:organization_id] = org.id
end
@conference = Conference.new(conference_params_copy)
org = Organization.find_or_create_by(name: 'organization')
@conference = Conference.new(conference_params)
@conference.organization = org
if @conference.save
# user that creates the conference becomes organizer of that conference
current_user.add_role :organizer, @conference