mirror of
https://github.com/ansible/awx.git
synced 2026-02-16 18:50:04 -03:30
Refactor message generator
* Job object can now control the output and generate K:V output for notification types that can support it * Notifications store the body as json/dict now to encode more information * Notification Type can further compose the message based on what is sensible for the notification type * This will also allow customizing the message template in the future * All notification types use sane defaults for the level of detail now
This commit is contained in:
@@ -3053,7 +3053,8 @@ class NotifierTest(GenericAPIView):
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
obj = self.get_object()
|
||||
notification = obj.generate_notification("Tower Notification Test", "Ansible Tower Test Notification")
|
||||
notification = obj.generate_notification("Tower Notification Test {}".format(obj.id),
|
||||
{"body": "Ansible Tower Test Notification {}".format(obj.id)})
|
||||
if not notification:
|
||||
return Response({}, status=status.HTTP_400_BAD_REQUEST)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user