Don't process attachments if argument is None or ''

This can happen during workflow processing
This commit is contained in:
mike cullerton 2021-10-18 11:19:56 -04:00
parent bfd931e854
commit 8de05b8fb6
1 changed files with 2 additions and 1 deletions

View File

@ -58,7 +58,8 @@ email(subject="My Subject", recipients="user@example.com", attachments=['Study_A
bcc = self.get_email_addresses(kwargs['bcc'], study_id)
if 'reply_to' in kwargs:
reply_to = kwargs['reply_to']
if 'attachments' in kwargs:
# Don't process if attachments is None or ''
if 'attachments' in kwargs and kwargs['attachments'] is not None and kwargs['attachments'] != '':
files = self.get_files(kwargs['attachments'], study_id)
else: