From 5cb56181d8912f1300d794b2f32d7cce87f11f38 Mon Sep 17 00:00:00 2001 From: Steven Bal Date: Mon, 2 Dec 2024 15:25:58 +0100 Subject: [PATCH] :truck: [#4788] Rename several fields on Objects API config model --- docker/setup_configuration/data.yaml | 4 ++-- .../contrib/objects_api/setup_configuration/models.py | 2 +- .../contrib/objects_api/setup_configuration/steps.py | 6 ++++-- .../tests/files/setup_config_objects_api.yaml | 4 ++-- .../tests/files/setup_config_objects_api_all_fields.yaml | 2 +- src/openforms/contrib/objects_api/tests/test_migrations.py | 2 +- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/docker/setup_configuration/data.yaml b/docker/setup_configuration/data.yaml index 7840c13d5e..ee428aec0f 100644 --- a/docker/setup_configuration/data.yaml +++ b/docker/setup_configuration/data.yaml @@ -37,7 +37,7 @@ objects_api: identifier: config-1 objects_service_identifier: objecten-test objecttypes_service_identifier: objecttypen-test - drc_service_identifier: documenten-test + documenten_service_identifier: documenten-test catalogi_service_identifier: catalogi-test catalogue_domain: TEST catalogue_rsin: "000000000" @@ -49,7 +49,7 @@ objects_api: identifier: config-2 objects_service_identifier: objecten-test objecttypes_service_identifier: objecttypen-test - drc_service_identifier: documenten-test + documenten_service_identifier: documenten-test catalogi_service_identifier: catalogi-test catalogue_domain: OTHER catalogue_rsin: "000000000" diff --git a/src/openforms/contrib/objects_api/setup_configuration/models.py b/src/openforms/contrib/objects_api/setup_configuration/models.py index bb4c45736a..2ab4701c1a 100644 --- a/src/openforms/contrib/objects_api/setup_configuration/models.py +++ b/src/openforms/contrib/objects_api/setup_configuration/models.py @@ -12,7 +12,7 @@ class SingleObjectsAPIGroupConfigModel(ConfigurationModel): objecttypes_service_identifier: str = DjangoModelRef( ObjectsAPIGroupConfig, "objecttypes_service" ) - drc_service_identifier: str = DjangoModelRef( + documenten_service_identifier: str = DjangoModelRef( ObjectsAPIGroupConfig, "drc_service", default="" ) catalogi_service_identifier: str = DjangoModelRef( diff --git a/src/openforms/contrib/objects_api/setup_configuration/steps.py b/src/openforms/contrib/objects_api/setup_configuration/steps.py index a63a07ba9d..11019a2f8a 100644 --- a/src/openforms/contrib/objects_api/setup_configuration/steps.py +++ b/src/openforms/contrib/objects_api/setup_configuration/steps.py @@ -43,8 +43,10 @@ def execute(self, model: ObjectsAPIGroupConfigModel): "iot_submission_csv": config.iot_submission_csv, "iot_attachment": config.iot_attachment, } - if config.drc_service_identifier: - defaults["drc_service"] = get_service(config.drc_service_identifier) + if config.documenten_service_identifier: + defaults["drc_service"] = get_service( + config.documenten_service_identifier + ) if config.catalogi_service_identifier: defaults["catalogi_service"] = get_service( config.catalogi_service_identifier diff --git a/src/openforms/contrib/objects_api/setup_configuration/tests/files/setup_config_objects_api.yaml b/src/openforms/contrib/objects_api/setup_configuration/tests/files/setup_config_objects_api.yaml index fb7f8cf03e..34acb86983 100644 --- a/src/openforms/contrib/objects_api/setup_configuration/tests/files/setup_config_objects_api.yaml +++ b/src/openforms/contrib/objects_api/setup_configuration/tests/files/setup_config_objects_api.yaml @@ -5,7 +5,7 @@ objects_api: identifier: config-1 objects_service_identifier: objecten-test objecttypes_service_identifier: objecttypen-test - drc_service_identifier: documenten-test + documenten_service_identifier: documenten-test catalogi_service_identifier: catalogi-test catalogue_domain: TEST catalogue_rsin: "000000000" @@ -17,7 +17,7 @@ objects_api: identifier: config-2 objects_service_identifier: objecten-test objecttypes_service_identifier: objecttypen-test - drc_service_identifier: documenten-test + documenten_service_identifier: documenten-test catalogi_service_identifier: catalogi-test catalogue_domain: OTHER catalogue_rsin: "000000000" diff --git a/src/openforms/contrib/objects_api/setup_configuration/tests/files/setup_config_objects_api_all_fields.yaml b/src/openforms/contrib/objects_api/setup_configuration/tests/files/setup_config_objects_api_all_fields.yaml index a89d894cc1..9a65406312 100644 --- a/src/openforms/contrib/objects_api/setup_configuration/tests/files/setup_config_objects_api_all_fields.yaml +++ b/src/openforms/contrib/objects_api/setup_configuration/tests/files/setup_config_objects_api_all_fields.yaml @@ -5,7 +5,7 @@ objects_api: identifier: config-1 objects_service_identifier: objecten-test objecttypes_service_identifier: objecttypen-test - drc_service_identifier: documenten-test + documenten_service_identifier: documenten-test catalogi_service_identifier: catalogi-test catalogue_domain: TEST catalogue_rsin: "000000000" diff --git a/src/openforms/contrib/objects_api/tests/test_migrations.py b/src/openforms/contrib/objects_api/tests/test_migrations.py index 6d8c5e82dd..e986b1b8fb 100644 --- a/src/openforms/contrib/objects_api/tests/test_migrations.py +++ b/src/openforms/contrib/objects_api/tests/test_migrations.py @@ -3,7 +3,7 @@ from openforms.utils.tests.test_migrations import TestMigrations -class MigrateFeatureFlagsTests(TestMigrations): +class AddObjectsAPIGroupIdentifierTests(TestMigrations): app = "objects_api" migrate_from = "0001_initial" migrate_to = "0002_objectsapigroupconfig_identifier"