mirror of
https://github.com/ansible/awx.git
synced 2026-05-16 05:47:38 -02:30
Fix up missing notifications in invsrc
This commit is contained in:
@@ -1184,14 +1184,21 @@ class InventorySource(UnifiedJobTemplate, InventorySourceOptions):
|
|||||||
def notification_templates(self):
|
def notification_templates(self):
|
||||||
base_notification_templates = NotificationTemplate.objects
|
base_notification_templates = NotificationTemplate.objects
|
||||||
error_notification_templates = list(base_notification_templates
|
error_notification_templates = list(base_notification_templates
|
||||||
.filter(organization_notification_templates_for_errors=self.inventory.organization))
|
.filter(unifiedjobtemplate_notification_templates_for_errors__in=[self]))
|
||||||
success_notification_templates = list(base_notification_templates
|
success_notification_templates = list(base_notification_templates
|
||||||
.filter(organization_notification_templates_for_success=self.inventory.organization))
|
.filter(unifiedjobtemplate_notification_templates_for_success__in=[self]))
|
||||||
any_notification_templates = list(base_notification_templates
|
any_notification_templates = list(base_notification_templates
|
||||||
.filter(organization_notification_templates_for_any=self.inventory.organization))
|
.filter(unifiedjobtemplate_notification_templates_for_any__in=[self]))
|
||||||
return dict(error=error_notification_templates,
|
if self.inventory.organization is not None:
|
||||||
success=success_notification_templates,
|
error_notification_templates = set(error_notification_templates + list(base_notification_templates
|
||||||
any=any_notification_templates)
|
.filter(organization_notification_templates_for_errors=self.inventory.organization)))
|
||||||
|
success_notification_templates = set(success_notification_templates + list(base_notification_templates
|
||||||
|
.filter(organization_notification_templates_for_success=self.inventory.organization)))
|
||||||
|
any_notification_templates = set(any_notification_templates + list(base_notification_templates
|
||||||
|
.filter(organization_notification_templates_for_any=self.inventory.organization)))
|
||||||
|
return dict(error=list(error_notification_templates),
|
||||||
|
success=list(success_notification_templates),
|
||||||
|
any=list(any_notification_templates))
|
||||||
|
|
||||||
def clean_source(self):
|
def clean_source(self):
|
||||||
source = self.source
|
source = self.source
|
||||||
|
|||||||
Reference in New Issue
Block a user