mirror of
https://github.com/sartography/cr-connect-workflow.git
synced 2025-02-23 05:08:32 +00:00
Can't use workflow_id, because that conflicts with the id of the current workflow (that we pass in to every script)
This commit is contained in:
parent
ea083e3a52
commit
826b98a6ea
@ -18,16 +18,16 @@ class EmailData(Script):
|
||||
|
||||
def do_task(self, task, study_id, workflow_id, **kwargs):
|
||||
email_models = None
|
||||
email_data = None
|
||||
if 'email_id' in kwargs:
|
||||
email_models = session.query(EmailModel).filter(EmailModel.id == kwargs['email_id']).all()
|
||||
elif 'workflow_id' in kwargs:
|
||||
email_models = session.query(EmailModel).filter(EmailModel.workflow_id == kwargs['workflow_id']).all()
|
||||
elif 'email_workflow_id' in kwargs:
|
||||
email_models = session.query(EmailModel).filter(EmailModel.workflow_id == str(kwargs['email_workflow_id'])).all()
|
||||
else:
|
||||
raise ApiError.from_task(code='missing_email_id',
|
||||
message='You must include an email_id with the get_email_data script.',
|
||||
task=task)
|
||||
|
||||
email_data = None
|
||||
if email_models:
|
||||
email_data = EmailModelSchema(many=True).dump(email_models)
|
||||
return email_data
|
||||
|
Loading…
x
Reference in New Issue
Block a user