More sane branching in confirm action of proposal controller
This commit is contained in:
parent
f4678e5415
commit
c35270ad31
1 changed files with 9 additions and 10 deletions
|
|
@ -110,12 +110,7 @@ class ProposalController < ApplicationController
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
unless @event.save
|
if @event.save
|
||||||
redirect_to conference_program_proposal_index_path(conference_id: @conference.short_title),
|
|
||||||
error: "Could not confirm proposal: #{@event.errors.full_messages.join(', ')}"
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if @conference.user_registered?(current_user)
|
if @conference.user_registered?(current_user)
|
||||||
redirect_to conference_program_proposal_index_path(@conference.short_title),
|
redirect_to conference_program_proposal_index_path(@conference.short_title),
|
||||||
notice: 'The proposal was confirmed.'
|
notice: 'The proposal was confirmed.'
|
||||||
|
|
@ -123,6 +118,10 @@ class ProposalController < ApplicationController
|
||||||
redirect_to new_conference_conference_registrations_path(conference_id: @conference.short_title),
|
redirect_to new_conference_conference_registrations_path(conference_id: @conference.short_title),
|
||||||
alert: 'The proposal was confirmed. Please register to attend the conference.'
|
alert: 'The proposal was confirmed. Please register to attend the conference.'
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
redirect_to conference_program_proposal_index_path(conference_id: @conference.short_title),
|
||||||
|
error: "Could not confirm proposal: #{@event.errors.full_messages.join(', ')}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def restart
|
def restart
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue