mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
make @user definition more clear
This commit is contained in:
parent
30831ce718
commit
2b433a9cbe
1 changed files with 11 additions and 1 deletions
|
|
@ -21,6 +21,8 @@ class ConferenceRegistrationsController < ApplicationController
|
|||
end
|
||||
|
||||
@registration = Registration.new
|
||||
|
||||
# @user variable needs to be set so that _sign_up_form_embedded works properly
|
||||
@user = @registration.build_user
|
||||
end
|
||||
|
||||
|
|
@ -34,7 +36,15 @@ class ConferenceRegistrationsController < ApplicationController
|
|||
|
||||
def create
|
||||
@registration = @conference.registrations.new(registration_params)
|
||||
@registration.user = current_user || ( @user = @registration.build_user(user_params))
|
||||
|
||||
if current_user == nil
|
||||
# @user variable needs to be set so that _sign_up_form_embedded works properly
|
||||
@user = @registration.build_user(user_params)
|
||||
else
|
||||
@user = current_user
|
||||
end
|
||||
|
||||
@registration.user = @user
|
||||
|
||||
if @registration.save
|
||||
# Trigger ahoy event
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue