Merges getStudyAssociates() endpoint

This commit is contained in:
NWalker4483 2021-07-20 13:57:32 -04:00
parent 4632c6374f
commit a263447806
419 changed files with 16 additions and 5 deletions

2
.gitignore vendored Normal file → Executable file
View File

@ -14,7 +14,7 @@ local.properties
.settings/ .settings/
.loadpath .loadpath
.recommenders .recommenders
.vscode/
# External tool builders # External tool builders
.externalToolBuilders/ .externalToolBuilders/

0
.sonarcloud.properties Normal file → Executable file
View File

0
.travis.yml Normal file → Executable file
View File

0
Dockerfile Normal file → Executable file
View File

0
LICENSE.md Normal file → Executable file
View File

0
Pipfile Normal file → Executable file
View File

0
Pipfile.lock generated Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
config/default.py Normal file → Executable file
View File

0
config/logging_example.py Normal file → Executable file
View File

0
config/testing.py Normal file → Executable file
View File

0
crc/__init__.py Normal file → Executable file
View File

0
crc/api.yml Normal file → Executable file
View File

0
crc/api/__init__.py Normal file → Executable file
View File

0
crc/api/admin.py Normal file → Executable file
View File

0
crc/api/common.py Normal file → Executable file
View File

0
crc/api/data_store.py Normal file → Executable file
View File

0
crc/api/document.py Normal file → Executable file
View File

0
crc/api/file.py Normal file → Executable file
View File

0
crc/api/study.py Normal file → Executable file
View File

0
crc/api/tools.py Normal file → Executable file
View File

0
crc/api/user.py Normal file → Executable file
View File

0
crc/api/workflow.py Normal file → Executable file
View File

0
crc/api/workflow_sync.py Normal file → Executable file
View File

0
crc/models/__init__.py Normal file → Executable file
View File

0
crc/models/api_models.py Normal file → Executable file
View File

0
crc/models/data_store.py Normal file → Executable file
View File

0
crc/models/email.py Normal file → Executable file
View File

0
crc/models/file.py Normal file → Executable file
View File

0
crc/models/ldap.py Normal file → Executable file
View File

0
crc/models/protocol_builder.py Normal file → Executable file
View File

1
crc/models/study.py Normal file → Executable file
View File

@ -79,6 +79,7 @@ class StudyAssociated(db.Model):
role = db.Column(db.String, nullable=True) role = db.Column(db.String, nullable=True)
send_email = db.Column(db.Boolean, nullable=True) send_email = db.Column(db.Boolean, nullable=True)
access = db.Column(db.Boolean, nullable=True) access = db.Column(db.Boolean, nullable=True)
class StudyAssociatedSchema(ma.Schema): class StudyAssociatedSchema(ma.Schema):
class Meta: class Meta:
model = StudyAssociated model = StudyAssociated

0
crc/models/task_event.py Normal file → Executable file
View File

0
crc/models/user.py Normal file → Executable file
View File

0
crc/models/workflow.py Normal file → Executable file
View File

0
crc/scripts/__init__.py Normal file → Executable file
View File

0
crc/scripts/check_study.py Normal file → Executable file
View File

0
crc/scripts/complete_template.py Normal file → Executable file
View File

0
crc/scripts/delete_file.py Normal file → Executable file
View File

0
crc/scripts/email.py Normal file → Executable file
View File

0
crc/scripts/fact_service.py Normal file → Executable file
View File

0
crc/scripts/failing_script.py Normal file → Executable file
View File

0
crc/scripts/file_data_get.py Normal file → Executable file
View File

0
crc/scripts/file_data_set.py Normal file → Executable file
View File

0
crc/scripts/get_dashboard_url.py Normal file → Executable file
View File

0
crc/scripts/get_irb_info.py Normal file → Executable file
View File

0
crc/scripts/get_study_associate.py Normal file → Executable file
View File

0
crc/scripts/get_study_associates.py Normal file → Executable file
View File

0
crc/scripts/is_file_uploaded.py Normal file → Executable file
View File

0
crc/scripts/ldap.py Normal file → Executable file
View File

0
crc/scripts/reset_workflow.py Normal file → Executable file
View File

0
crc/scripts/script.py Normal file → Executable file
View File

0
crc/scripts/study_data_get.py Normal file → Executable file
View File

0
crc/scripts/study_data_set.py Normal file → Executable file
View File

0
crc/scripts/study_info.py Normal file → Executable file
View File

0
crc/scripts/update_study.py Normal file → Executable file
View File

0
crc/scripts/update_study_associate.py Normal file → Executable file
View File

0
crc/scripts/update_study_associates.py Normal file → Executable file
View File

0
crc/scripts/user_data_get.py Normal file → Executable file
View File

0
crc/scripts/user_data_set.py Normal file → Executable file
View File

0
crc/services/__init__.py Normal file → Executable file
View File

0
crc/services/cache_service.py Normal file → Executable file
View File

0
crc/services/data_store_service.py Normal file → Executable file
View File

0
crc/services/document_service.py Normal file → Executable file
View File

0
crc/services/email_service.py Normal file → Executable file
View File

0
crc/services/error_service.py Normal file → Executable file
View File

0
crc/services/failing_service.py Normal file → Executable file
View File

0
crc/services/file_service.py Normal file → Executable file
View File

0
crc/services/ldap_service.py Normal file → Executable file
View File

0
crc/services/lookup_service.py Normal file → Executable file
View File

0
crc/services/protocol_builder.py Normal file → Executable file
View File

14
crc/services/study_service.py Normal file → Executable file
View File

@ -24,6 +24,7 @@ from crc.models.task_event import TaskEventModel, TaskEvent
from crc.models.workflow import WorkflowSpecCategoryModel, WorkflowModel, WorkflowSpecModel, WorkflowState, \ from crc.models.workflow import WorkflowSpecCategoryModel, WorkflowModel, WorkflowSpecModel, WorkflowState, \
WorkflowStatus, WorkflowSpecDependencyFile WorkflowStatus, WorkflowSpecDependencyFile
from crc.services.document_service import DocumentService from crc.services.document_service import DocumentService
from crc.services.file_service import FileService from crc.services.file_service import FileService
from crc.services.ldap_service import LdapService from crc.services.ldap_service import LdapService
from crc.services.lookup_service import LookupService from crc.services.lookup_service import LookupService
@ -129,7 +130,11 @@ class StudyService(object):
person = db.session.query(StudyAssociated).filter((StudyAssociated.study_id == study_id)&( person = db.session.query(StudyAssociated).filter((StudyAssociated.study_id == study_id)&(
StudyAssociated.uid == uid)).first() StudyAssociated.uid == uid)).first()
if person: if person:
return StudyAssociatedSchema().dump(person) newAssociate = {'uid': person.uid}
newAssociate['role'] = person.role
newAssociate['send_email'] = person.send_email
newAssociate['access'] = person.access
return newAssociate
raise ApiError('uid_not_associated_with_study',"user id %s was not associated with study number %d"%(uid, raise ApiError('uid_not_associated_with_study',"user id %s was not associated with study number %d"%(uid,
study_id)) study_id))
@ -148,7 +153,12 @@ class StudyService(object):
people = db.session.query(StudyAssociated).filter(StudyAssociated.study_id == study_id) people = db.session.query(StudyAssociated).filter(StudyAssociated.study_id == study_id)
people_list = [{'uid':ownerid,'role':'owner','send_email':True,'access':True}] people_list = [{'uid':ownerid,'role':'owner','send_email':True,'access':True}]
people_list += StudyAssociatedSchema().dump(people, many=True) for person in people:
newAssociate = {'uid':person.uid}
newAssociate['role'] = person.role
newAssociate['send_email'] = person.send_email
newAssociate['access'] = person.access
people_list.append(newAssociate)
return people_list return people_list

0
crc/services/user_service.py Normal file → Executable file
View File

0
crc/services/workflow_processor.py Normal file → Executable file
View File

4
crc/services/workflow_service.py Normal file → Executable file
View File

@ -765,7 +765,7 @@ class WorkflowService(object):
else: else:
if not hasattr(spiff_task.task_spec, 'lane') or spiff_task.task_spec.lane is None: if not hasattr(spiff_task.task_spec, 'lane') or spiff_task.task_spec.lane is None:
associated = StudyService.get_study_associates(processor.workflow_model.study.id) associated = StudyService.get_study_associates(processor.workflow_model.study.id)
return [user['uid'] for user in associated if user['access']] return [user['uid'] for user in associated if user.get("access")]
if spiff_task.task_spec.lane not in spiff_task.data: if spiff_task.task_spec.lane not in spiff_task.data:
return [] # No users are assignable to the task at this moment return [] # No users are assignable to the task at this moment
lane_users = spiff_task.data[spiff_task.task_spec.lane] lane_users = spiff_task.data[spiff_task.task_spec.lane]
@ -775,7 +775,7 @@ class WorkflowService(object):
lane_uids = [] lane_uids = []
for user in lane_users: for user in lane_users:
if isinstance(user, dict): if isinstance(user, dict):
if 'value' in user and user['value'] is not None: if user.get("value"):
lane_uids.append(user['value']) lane_uids.append(user['value'])
else: else:
raise ApiError.from_task(code="task_lane_user_error", message="Spiff Task %s lane user dict must have a key called 'value' with the user's uid in it." % raise ApiError.from_task(code="task_lane_user_error", message="Spiff Task %s lane user dict must have a key called 'value' with the user's uid in it." %

0
crc/services/workflow_sync.py Normal file → Executable file
View File

0
crc/static/bpmn/abandoned/abandoned.bpmn Normal file → Executable file
View File

0
crc/static/bpmn/core_info/SponsorList.xls Normal file → Executable file
View File

0
crc/static/bpmn/core_info/core_info.bpmn Normal file → Executable file
View File

View File

View File

View File

0
crc/static/bpmn/data_security_plan/HIPAA_Ids.xls Normal file → Executable file
View File

View File

View File

View File

View File

View File

View File

0
crc/static/bpmn/enrollment_date/enrollment_date.bpmn Normal file → Executable file
View File

0
crc/static/bpmn/finance/finance.bpmn Normal file → Executable file
View File

0
crc/static/bpmn/hold/hold.bpmn Normal file → Executable file
View File

0
crc/static/bpmn/ide_supplement/SponsorList.xls Normal file → Executable file
View File

0
crc/static/bpmn/ide_supplement/decision_ide_check.dmn Normal file → Executable file
View File

0
crc/static/bpmn/ide_supplement/ide_update.bpmn Normal file → Executable file
View File

View File

View File

0
crc/static/bpmn/ids_full_submission/ivrs_iwrs_ixrs.dmn Normal file → Executable file
View File

View File

0
crc/static/bpmn/ids_waiver/ids_waiver.bpmn Normal file → Executable file
View File

Some files were not shown because too many files have changed in this diff Show More