diff --git a/arkindex/process/models.py b/arkindex/process/models.py index 9da233f5fc86d6d5dfda157bada7e2659bcd3d1d..e95912170858bcb08c23721e84be2f57847d02d0 100644 --- a/arkindex/process/models.py +++ b/arkindex/process/models.py @@ -463,7 +463,7 @@ class Process(IndexableModel): if settings.INGEST_S3_REGION: recipe['env']['INGEST_S3_REGION'] = settings.INGEST_S3_REGION - elif settings.IMPORTS_WORKER_VERSION and self.mode == ProcessMode.Files: + if settings.IMPORTS_WORKER_VERSION and self.mode in (ProcessMode.Files, ProcessMode.S3): recipe['env']['WORKER_VERSION_ID'] = str(settings.IMPORTS_WORKER_VERSION) if self.corpus: diff --git a/arkindex/process/tests/test_create_s3_import.py b/arkindex/process/tests/test_create_s3_import.py index 5af39140d6ae9e8ad93ba946a22bfbed8541f401..ad12d1843f939852ece9ee1d4b872af41682b83f 100644 --- a/arkindex/process/tests/test_create_s3_import.py +++ b/arkindex/process/tests/test_create_s3_import.py @@ -114,6 +114,7 @@ class TestCreateS3Import(FixtureTestCase): INGEST_S3_REGION=None, INGEST_S3_ACCESS_KEY='🔑', INGEST_S3_SECRET_KEY='its-secret-i-wont-tell-you', + IMPORTS_WORKER_VERSION='aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', ) def test_create(self): self.user.user_scopes.create(scope=Scope.S3Ingest) @@ -157,6 +158,7 @@ class TestCreateS3Import(FixtureTestCase): 'INGEST_S3_ENDPOINT': 'http://s3.null.teklia.com', 'INGEST_S3_ACCESS_KEY': '🔑', 'INGEST_S3_SECRET_KEY': 'its-secret-i-wont-tell-you', + 'WORKER_VERSION_ID': 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', }) @override_settings( @@ -167,6 +169,7 @@ class TestCreateS3Import(FixtureTestCase): INGEST_S3_REGION=None, INGEST_S3_ACCESS_KEY='🔑', INGEST_S3_SECRET_KEY='its-secret-i-wont-tell-you', + IMPORTS_WORKER_VERSION='aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', ) def test_defaults(self): self.user.user_scopes.create(scope=Scope.S3Ingest) @@ -205,4 +208,5 @@ class TestCreateS3Import(FixtureTestCase): 'INGEST_S3_ENDPOINT': 'http://s3.null.teklia.com', 'INGEST_S3_ACCESS_KEY': '🔑', 'INGEST_S3_SECRET_KEY': 'its-secret-i-wont-tell-you', + 'WORKER_VERSION_ID': 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', })