handle map or list parameters

This commit is contained in:
Jay Udey 2020-02-04 14:04:45 -06:00
parent 70b2d3ab3c
commit 4f0c06ca53

View File

@ -148,11 +148,15 @@ class SESBackend(BaseBackend):
def __type_of_message__(self, destinations): def __type_of_message__(self, destinations):
"""Checks the destination for any special address that could indicate delivery, """Checks the destination for any special address that could indicate delivery,
complaint or bounce like in SES simulator""" complaint or bounce like in SES simulator"""
alladdress = ( if isinstance(destinations, list):
destinations.get("ToAddresses", []) alladdress = destinations
+ destinations.get("CcAddresses", []) else:
+ destinations.get("BccAddresses", []) alladdress = (
) destinations.get("ToAddresses", [])
+ destinations.get("CcAddresses", [])
+ destinations.get("BccAddresses", [])
)
for addr in alladdress: for addr in alladdress:
if SESFeedback.SUCCESS_ADDR in addr: if SESFeedback.SUCCESS_ADDR in addr:
return SESFeedback.DELIVERY return SESFeedback.DELIVERY