mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
FIX: creating an automation without script should error (#28752)
This commit ensure we are properly showing an error to the end user and not just a vague 500.
This commit is contained in:
@ -27,7 +27,8 @@ module DiscourseAutomation
|
||||
DiscourseAutomation::Automation.new(
|
||||
automation_params.merge(last_updated_by_id: current_user.id),
|
||||
)
|
||||
if automation.scriptable.forced_triggerable
|
||||
|
||||
if automation.scriptable&.forced_triggerable
|
||||
automation.trigger = scriptable.forced_triggerable[:triggerable].to_s
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user