mirror of
https://github.com/ansible/awx.git
synced 2026-04-13 22:19:27 -02:30
Update ad_hoc_commands.py
refactoring code with set comprehension which is more concise and efficient
This commit is contained in:
@@ -160,9 +160,7 @@ class AdHocCommand(UnifiedJob, JobNotificationMixin):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def notification_templates(self):
|
def notification_templates(self):
|
||||||
all_orgs = set()
|
all_orgs = {h.inventory.organization for h in self.hosts.all()}
|
||||||
for h in self.hosts.all():
|
|
||||||
all_orgs.add(h.inventory.organization)
|
|
||||||
active_templates = dict(error=set(), success=set(), started=set())
|
active_templates = dict(error=set(), success=set(), started=set())
|
||||||
base_notification_templates = NotificationTemplate.objects
|
base_notification_templates = NotificationTemplate.objects
|
||||||
for org in all_orgs:
|
for org in all_orgs:
|
||||||
|
|||||||
Reference in New Issue
Block a user