mirror of
https://github.com/sartography/cr-connect-workflow.git
synced 2025-02-24 05:38:25 +00:00
Remove code that doesn't let master workflow set state and state_message for admin sandbox workflows
Remove test for this feature
This commit is contained in:
parent
5b2b2f7b60
commit
95c915a434
@ -1148,13 +1148,8 @@ class WorkflowService(object):
|
|||||||
if WorkflowState.has_value(workflow_state):
|
if WorkflowState.has_value(workflow_state):
|
||||||
# Get the workflow from our dictionary and set the state
|
# Get the workflow from our dictionary and set the state
|
||||||
workflow = wf_by_workflow_spec_id[workflow_spec_id]
|
workflow = wf_by_workflow_spec_id[workflow_spec_id]
|
||||||
# Don't let the master workflow change the state for admin workflows
|
workflow.state = workflow_state
|
||||||
if WorkflowService.is_admin_workflow(workflow_spec_id):
|
workflow.state_message = workflow_state_message
|
||||||
workflow.state = 'optional'
|
|
||||||
workflow.state_message = 'This is an Admin workflow'
|
|
||||||
else:
|
|
||||||
workflow.state = workflow_state
|
|
||||||
workflow.state_message = workflow_state_message
|
|
||||||
session.add(workflow)
|
session.add(workflow)
|
||||||
|
|
||||||
session.commit()
|
session.commit()
|
||||||
|
@ -102,24 +102,6 @@ class TestStudyApi(BaseTest):
|
|||||||
self.assertEqual('Completion of this workflow is required.', workflows[0].state_message)
|
self.assertEqual('Completion of this workflow is required.', workflows[0].state_message)
|
||||||
self.assertEqual('This workflow is locked', workflows[1].state_message)
|
self.assertEqual('This workflow is locked', workflows[1].state_message)
|
||||||
|
|
||||||
def test_admin_workflows_not_locked(self):
|
|
||||||
"""Admin category workflows should not be locked by the master workflow"""
|
|
||||||
# Add an admin category
|
|
||||||
self.assure_category_exists('test_admin_category', admin=True)
|
|
||||||
# Add a workflow to the admin category
|
|
||||||
self.load_test_spec('empty_workflow', category_id='test_admin_category')
|
|
||||||
# Add a master workflow that tries to lock the workflow
|
|
||||||
self.load_test_spec('test_master_workflow', master_spec=True)
|
|
||||||
|
|
||||||
study = self.add_test_study()
|
|
||||||
study_model = session.query(StudyModel).filter_by(id=study["id"]).first()
|
|
||||||
self.run_master_spec(study_model)
|
|
||||||
|
|
||||||
workflows = session.query(WorkflowModel).all()
|
|
||||||
self.assertEqual(1, len(workflows))
|
|
||||||
# The master workflow tries to lock this, but we don't lock if Admin category
|
|
||||||
self.assertEqual('optional', workflows[0].state)
|
|
||||||
|
|
||||||
def test_get_study_has_details_about_files(self):
|
def test_get_study_has_details_about_files(self):
|
||||||
|
|
||||||
# Set up the study and attach a file to it.
|
# Set up the study and attach a file to it.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user