From e9fd76ed997f40e6f53fdf111eb6cdbc0241aeff Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 9 Feb 2022 12:11:51 -0500 Subject: [PATCH] lookup service tests passing, but I need to revist this. --- crc/services/lookup_service.py | 3 ++- tests/test_lookup_service.py | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crc/services/lookup_service.py b/crc/services/lookup_service.py index 89207a35..fd2d692f 100644 --- a/crc/services/lookup_service.py +++ b/crc/services/lookup_service.py @@ -77,7 +77,8 @@ class LookupService(object): if lookup_model.is_ldap: # LDAP is always current is_current = True else: - current_date = SpecFileService.last_modified(workflow.workflow_spec, lookup_model.file_name) + workflow_spec = WorkflowSpecService().get_spec(workflow.workflow_spec_id) + current_date = SpecFileService.last_modified(workflow_spec, lookup_model.file_name) is_current = current_date == lookup_model.last_updated if not is_current: diff --git a/tests/test_lookup_service.py b/tests/test_lookup_service.py index b604a71b..71157ba0 100644 --- a/tests/test_lookup_service.py +++ b/tests/test_lookup_service.py @@ -49,8 +49,7 @@ class TestLookupService(BaseTest): file_path = os.path.join(app.root_path, '..', 'tests', 'data', 'enum_options_with_search', 'sponsors_modified.xlsx') file = open(file_path, 'rb') - workflow_spec_model = session.query(WorkflowSpecModel)\ - .filter(WorkflowSpecModel.id == workflow.workflow_spec_id).first() + workflow_spec_model = self.workflow_spec_service.get_spec(workflow.workflow_spec_id) SpecFileService().update_file(workflow_spec_model, "sponsors.xlsx", file.read()) file.close()