mirror of
https://github.com/ansible/awx.git
synced 2026-03-26 21:35:01 -02:30
Enforce org dependency of notification template.
This commit is contained in:
@@ -27,7 +27,7 @@ logger = logging.getLogger('awx.main.models.notifications')
|
||||
__all__ = ['NotificationTemplate', 'Notification']
|
||||
|
||||
|
||||
class NotificationTemplate(CommonModel):
|
||||
class NotificationTemplate(CommonModelNameNotUnique):
|
||||
|
||||
NOTIFICATION_TYPES = [('email', _('Email'), CustomEmailBackend),
|
||||
('slack', _('Slack'), SlackBackend),
|
||||
@@ -41,12 +41,13 @@ class NotificationTemplate(CommonModel):
|
||||
|
||||
class Meta:
|
||||
app_label = 'main'
|
||||
unique_together = ('organization', 'name')
|
||||
|
||||
organization = models.ForeignKey(
|
||||
'Organization',
|
||||
blank=False,
|
||||
null=True,
|
||||
on_delete=models.SET_NULL,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='notification_templates',
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user