1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Allow instant cancel for new jobs

This commit is contained in:
AlanCoding 2016-07-21 09:05:32 -04:00
parent 53de76d6e0
commit 7e49a428e6

View File

@ -873,7 +873,7 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique
if not self.cancel_flag:
self.cancel_flag = True
cancel_fields = ['cancel_flag']
if self.status in ('pending', 'waiting'):
if self.status in ('pending', 'waiting', 'new'):
self.status = 'canceled'
cancel_fields.append('status')
self.save(update_fields=cancel_fields)