Return full webhook dict when serializing notif.

This commit is contained in:
Jim Ladd 2019-10-21 16:44:03 -07:00 committed by Ryan Petrello
parent b024d91c66
commit 47031da65b
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

View File

@ -4522,8 +4522,8 @@ class NotificationSerializer(BaseSerializer):
# attempt to load json string
try:
potential_body = json.loads(obj.body)
if isinstance(potential_body, dict) and 'body' in potential_body:
return potential_body['body']
if isinstance(potential_body, dict):
return potential_body
except json.JSONDecodeError:
pass
return obj.body