ensure wizard exists before forcing redirect
Dieser Commit ist enthalten in:
Ursprung
80e5bcc0dc
Commit
62ee016c7c
2 geänderte Dateien mit 7 neuen und 1 gelöschten Zeilen
|
@ -182,6 +182,10 @@ class CustomWizard::Wizard
|
|||
PluginStore.get('custom_wizard', wizard_id)
|
||||
end
|
||||
|
||||
def self.exists?(wizard_id)
|
||||
PluginStoreRow.exists?(plugin_name: 'custom_wizard', key: wizard_id)
|
||||
end
|
||||
|
||||
def self.create(user, wizard_id)
|
||||
CustomWizard::Wizard.new(user, self.find(wizard_id).to_h)
|
||||
end
|
||||
|
|
|
@ -128,10 +128,12 @@ after_initialize do
|
|||
CustomWizard::Wizard.set_submission_redirect(current_user, wizard_id, request.referer)
|
||||
end
|
||||
|
||||
if CustomWizard::Wizard.exists?(wizard_id)
|
||||
redirect_to "/w/#{wizard_id.dasherize}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
add_to_serializer(:current_user, :redirect_to_wizard) { object.custom_fields['redirect_to_wizard'] }
|
||||
|
||||
|
|
Laden …
In neuem Issue referenzieren