only cancel deps if we can cancel the inv update

This commit is contained in:
Chris Meyers 2017-02-27 11:37:29 -05:00
parent f3e514246e
commit c1bace87ab

View File

@ -1279,7 +1279,8 @@ class InventoryUpdate(UnifiedJob, InventorySourceOptions, JobNotificationMixin):
def cancel(self):
res = super(InventoryUpdate, self).cancel()
map(lambda x: x.cancel(), Job.objects.filter(dependent_jobs__in=[self.id]))
if res:
map(lambda x: x.cancel(), Job.objects.filter(dependent_jobs__in=[self.id]))
return res