mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 22:37:41 -02:30
Revert required org on notification templates
This reverts the validation of a required Organization on the Notification Template. After discussion with jlaska and jladd, I think this can behave fine in this situation. It's more like a Credential then where without an Organization the NT only becomes available to Super Users and the creator of the NT.
This commit is contained in:
@@ -2429,16 +2429,8 @@ class NotificationTemplateSerializer(BaseSerializer):
|
|||||||
notification_type = self.instance.notification_type
|
notification_type = self.instance.notification_type
|
||||||
else:
|
else:
|
||||||
notification_type = None
|
notification_type = None
|
||||||
if 'organization' in attrs:
|
|
||||||
organization = attrs['organization']
|
|
||||||
elif self.instance:
|
|
||||||
organization = self.instance.organization
|
|
||||||
else:
|
|
||||||
organization = None
|
|
||||||
if not notification_type:
|
if not notification_type:
|
||||||
raise serializers.ValidationError('Missing required fields for Notification Configuration: notification_type')
|
raise serializers.ValidationError('Missing required fields for Notification Configuration: notification_type')
|
||||||
if not organization:
|
|
||||||
raise serializers.ValidationError("Missing 'organization' from required fields")
|
|
||||||
|
|
||||||
notification_class = NotificationTemplate.CLASS_FOR_NOTIFICATION_TYPE[notification_type]
|
notification_class = NotificationTemplate.CLASS_FOR_NOTIFICATION_TYPE[notification_type]
|
||||||
missing_fields = []
|
missing_fields = []
|
||||||
|
|||||||
Reference in New Issue
Block a user