mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
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:
parent
e9a0f41152
commit
e9afee6149
@ -2429,16 +2429,8 @@ class NotificationTemplateSerializer(BaseSerializer):
|
||||
notification_type = self.instance.notification_type
|
||||
else:
|
||||
notification_type = None
|
||||
if 'organization' in attrs:
|
||||
organization = attrs['organization']
|
||||
elif self.instance:
|
||||
organization = self.instance.organization
|
||||
else:
|
||||
organization = None
|
||||
if not 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]
|
||||
missing_fields = []
|
||||
|
Loading…
Reference in New Issue
Block a user