Merge remote-tracking branch 'origin/dev' into master-workflow-status-messages-222

This commit is contained in:
Dan 2021-03-26 17:47:57 -04:00
commit ac4877fecf
6 changed files with 17 additions and 15 deletions

View File

@ -1,4 +1,4 @@
FROM python:3.8
FROM quay.io/sartography/python:3.8
RUN pip install pipenv
RUN useradd _gunicorn --no-create-home --user-group

View File

@ -1,8 +1,7 @@
from crc import app
from crc.api.common import ApiError
from crc.models.user import UserModel
from crc.scripts.script import Script
# from crc.services.ldap_service import LdapService
from crc.services.ldap_service import LdapService
from crc.services.email_service import EmailService
from crc.services.study_service import StudyService
@ -101,13 +100,10 @@ email (subject="My Subject", recipients=["dhf8r@virginia.edu", pi.email], cc='as
@staticmethod
def get_associated_emails(study_id):
associated_uids = []
associated_emails = []
associates = StudyService.get_study_associates(study_id)
for associate in associates:
if associate['send_email'] is True:
associated_uids.append(associate['uid'])
returned = UserModel.query.filter(UserModel.uid.in_(associated_uids)).all()
for item in returned:
associated_emails.append(item.email_address)
user_info = LdapService.user_info(associate['uid'])
associated_emails.append(user_info.email_address)
return associated_emails

View File

@ -19,8 +19,11 @@ example : get_study_associates() => [{'uid':'sbp3ey','role':'Unicorn Herder', 's
"""
def do_task_validate_only(self, task, study_id, workflow_id, *args, **kwargs):
return True
study_associates = [
{'uid': 'dhf8r', 'role': 'Chief Bee Keeper', 'send_email': True, 'access': True},
{'uid': 'lb3dp', 'role': 'Chief Cat Herder', 'send_email': True, 'access': True}
]
return study_associates
def do_task(self, task, study_id, workflow_id, *args, **kwargs):

View File

@ -34,7 +34,7 @@ imagesize==1.2.0
inflection==0.5.1
itsdangerous==1.1.0
jdcal==1.4.1
jinja2==2.11.2
jinja2==2.11.3
jsonschema==3.2.0
ldap3==2.8.1
lxml==4.6.2
@ -63,7 +63,7 @@ python-docx==0.8.10
python-editor==1.0.4
python-levenshtein==0.12.0
pytz==2020.4
pyyaml==5.3.1
pyyaml==5.4
recommonmark==0.6.0
requests==2.25.0
sentry-sdk==0.14.4

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0kmksnn" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0">
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0kmksnn" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.5.0">
<bpmn:process id="Process_0exnnpv" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_1nfe5m9</bpmn:outgoing>
@ -30,7 +30,10 @@ out4 = get_study_associate('lb3dp')</bpmn:script>
<bpmn:scriptTask id="Activity_0run091" name="setval - 2">
<bpmn:incoming>Flow_14n3ixy</bpmn:incoming>
<bpmn:outgoing>Flow_1vlh6s0</bpmn:outgoing>
<bpmn:script>update_study_associates([{'uid':'lb3dp','role':'SuperGal','send_email':False,'access':True}])</bpmn:script>
<bpmn:script>uids = []
for assoc in out:
uids.append(assoc['uid'])
update_study_associates([{'uid':'lb3dp','role':'SuperGal','send_email':False,'access':True}])</bpmn:script>
</bpmn:scriptTask>
<bpmn:sequenceFlow id="Flow_1vlh6s0" sourceRef="Activity_0run091" targetRef="Activity_0d8iftx" />
<bpmn:scriptTask id="Activity_14td33q" name="getval">

View File

@ -1,10 +1,10 @@
from tests.base_test import BaseTest
import json
from unittest.mock import patch
import flask
from crc.api.common import ApiError
from crc.services.user_service import UserService
from tests.base_test import BaseTest
from crc import session, app
from crc.models.study import StudyModel