Redirect to personal profile creation after event creation
This commit is contained in:
parent
d1b3d2cc04
commit
44612e1d52
|
@ -17,7 +17,7 @@ module Public
|
|||
@event.participations.build participant: current_user, approved: true
|
||||
|
||||
if @event.save
|
||||
redirect_to action: :index
|
||||
after_save_redirect
|
||||
else
|
||||
render action: :new
|
||||
end
|
||||
|
@ -32,5 +32,13 @@ module Public
|
|||
:event_type_id
|
||||
)
|
||||
end
|
||||
|
||||
def after_save_redirect
|
||||
if current_user.personal_profile(current_conference).present?
|
||||
redirect_to root_path
|
||||
else
|
||||
redirect_to new_personal_profile_path, alert: I18n.t(:please_fill_in_your_speaker_profile)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue