mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
suggested changes
This commit is contained in:
parent
949f5cb591
commit
b29856a122
2 changed files with 3 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue