Skip to content

Commit

Permalink
Loosen up body check on template
Browse files Browse the repository at this point in the history
  • Loading branch information
David O Neill authored and dmzoneill committed Mar 29, 2024
1 parent 7571df4 commit bb323c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion awx/main/models/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def build_notification_message(self, nt, status):
# Body should have at least 2 CRLF, some clients will interpret
# the email incorrectly with blank body. So we will check that

if len(body.strip().splitlines()) <= 2:
if len(body.strip().splitlines()) < 1:
# blank body
body = '\r\n'.join(
[
Expand Down
2 changes: 1 addition & 1 deletion awx_collection/test/awx/test_notification_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ def test_build_notification_message_undefined(run_module, admin_user, organizati
nt = NotificationTemplate.objects.get(id=result['id'])

body = job.build_notification_message(nt, 'running')
assert 'The template rendering return a blank body' in body[1]
assert '{"started_by": "My Placeholder"}' in body[1]

0 comments on commit bb323c5

Please sign in to comment.