mirror of
https://github.com/sartography/cr-connect-workflow.git
synced 2025-02-23 05:08:32 +00:00
Fixed email_cc test
This commit is contained in:
parent
b94d49076d
commit
38b8c7fcdf
@ -394,7 +394,7 @@ paths:
|
|||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Study"
|
$ref: "#/components/schemas/Study"
|
||||||
/study/{study_id}/associates':
|
/study/{study_id}/associates:
|
||||||
parameters:
|
parameters:
|
||||||
- name: study_id
|
- name: study_id
|
||||||
in: path
|
in: path
|
||||||
|
@ -122,14 +122,18 @@ class StudyService(object):
|
|||||||
raise ApiError('uid not specified','A valid uva uid is required for this function')
|
raise ApiError('uid not specified','A valid uva uid is required for this function')
|
||||||
|
|
||||||
if uid == study.user_uid:
|
if uid == study.user_uid:
|
||||||
return {'uid': ownerid, 'role': 'owner', 'send_email': True, 'access': True}
|
return {'uid': uid, 'role': 'owner', 'send_email': True, 'access': True}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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 +152,13 @@ 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
|
||||||
|
|
||||||
|
|
||||||
|
@ -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]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user