From 26302cbad158ed7a111562086cf719dd0810742c Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Tue, 24 Apr 2018 10:55:03 +1000 Subject: [PATCH] Restrict the cancelling of a scheduled after_time job is restricted to the current wizard --- controllers/admin.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/admin.rb b/controllers/admin.rb index df3d690c..b5259db4 100644 --- a/controllers/admin.rb +++ b/controllers/admin.rb @@ -92,12 +92,12 @@ class CustomWizard::AdminController < ::ApplicationController true if wizard['after_time'] && new_time - Jobs.cancel_scheduled_job(:set_after_time_wizard) + Jobs.cancel_scheduled_job(:set_after_time_wizard, wizard_id: wizard['id']) Jobs.enqueue_at(after_time_scheduled, :set_after_time_wizard, wizard_id: wizard['id']) end if existing['after_time'] && !wizard['after_time'] - Jobs.cancel_scheduled_job(:set_after_time_wizard) + Jobs.cancel_scheduled_job(:set_after_time_wizard, wizard_id: wizard['id']) Jobs.enqueue(:clear_after_time_wizard, wizard_id: wizard['id']) end