0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 17:30:29 +01:00

Properly clean up route_to after it's used

Dieser Commit ist enthalten in:
Angus McLeod 2019-08-29 10:22:02 +10:00
Ursprung f4a5b49446
Commit b779642422

Datei anzeigen

@ -149,6 +149,10 @@ class CustomWizard::Builder
final_step = updater.step.next.nil? final_step = updater.step.next.nil?
if route_to = data['route_to']
data.delete('route_to')
end
if @wizard.save_submissions && updater.errors.empty? if @wizard.save_submissions && updater.errors.empty?
save_submissions(data, final_step) save_submissions(data, final_step)
elsif final_step elsif final_step
@ -162,8 +166,8 @@ class CustomWizard::Builder
if updater.errors.empty? if updater.errors.empty?
if final_step if final_step
updater.result[:redirect_on_complete] = data['route_to'] || data['redirect_on_complete'] updater.result[:redirect_on_complete] = route_to || data['redirect_on_complete']
elsif route_to = data['route_to'] elsif
updater.result[:redirect_on_next] = route_to updater.result[:redirect_on_next] = route_to
end end
end end