Change workflow_id to workflow_spec_id

This commit is contained in:
mike cullerton 2021-10-12 13:43:29 -04:00
parent 699fc7daac
commit 63df614f41
2 changed files with 5 additions and 3 deletions

View File

@ -66,6 +66,8 @@ email(subject="My Subject", recipients="user@example.com", attachments=['Study_A
message="Email script requires a subject and at least one email recipient as arguments")
if recipients:
wf_model = session.query(WorkflowModel).filter(WorkflowModel.id == workflow_id).first()
workflow_spec_id = wf_model.workflow_spec_id
message = task.task_spec.documentation
data = task.data
try:
@ -81,7 +83,7 @@ email(subject="My Subject", recipients="user@example.com", attachments=['Study_A
study_id=study_id,
reply_to=reply_to,
attachment_files=files,
workflow_id=workflow_id
workflow_spec_id=workflow_spec_id
)
except Exception as e:
exc_type, exc_value, exc_traceback = sys.exc_info()

View File

@ -17,7 +17,7 @@ class EmailService(object):
@staticmethod
def add_email(subject, sender, recipients, content, content_html,
cc=None, bcc=None, study_id=None, reply_to=None, attachment_files=None, workflow_id=None):
cc=None, bcc=None, study_id=None, reply_to=None, attachment_files=None, workflow_spec_id=None):
"""We will receive all data related to an email and store it"""
# Find corresponding study - if any
@ -28,7 +28,7 @@ class EmailService(object):
# Create EmailModel
email_model = EmailModel(subject=subject, sender=sender, recipients=str(recipients),
content=content, content_html=content_html, study=study,
cc=cc, bcc=bcc, workflow_id=workflow_id)
cc=cc, bcc=bcc, workflow_spec_id=workflow_spec_id)
# Send mail
try: