From 860c99750b59cd3dca54b531417facbb7992d201 Mon Sep 17 00:00:00 2001 From: Sergei Maertens Date: Fri, 15 Nov 2024 21:04:54 +0100 Subject: [PATCH] :art: [#4344] Emit correct validation error code --- src/openforms/registrations/contrib/zgw_apis/options.py | 2 +- .../registrations/contrib/zgw_apis/tests/test_validators.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openforms/registrations/contrib/zgw_apis/options.py b/src/openforms/registrations/contrib/zgw_apis/options.py index d98c2ff5c3..695c57469f 100644 --- a/src/openforms/registrations/contrib/zgw_apis/options.py +++ b/src/openforms/registrations/contrib/zgw_apis/options.py @@ -304,7 +304,7 @@ def _validate_against_objects_api_group(attrs: RegistrationOptions) -> None: "Objects API group must be specified if an objecttype is specified." ) }, - code="invalid", + code="required", ) # `objecttypes_service` is required on `ObjectsAPIGroup` diff --git a/src/openforms/registrations/contrib/zgw_apis/tests/test_validators.py b/src/openforms/registrations/contrib/zgw_apis/tests/test_validators.py index 63868d1329..c4c5e92795 100644 --- a/src/openforms/registrations/contrib/zgw_apis/tests/test_validators.py +++ b/src/openforms/registrations/contrib/zgw_apis/tests/test_validators.py @@ -518,7 +518,7 @@ def test_validation_objects_api_group_not_null_if_objecttype_is_defined(self): self.assertFalse(result) self.assertIn("objects_api_group", serializer.errors) err = serializer.errors["objects_api_group"][0] - self.assertEqual(err.code, "invalid") + self.assertEqual(err.code, "required") def test_validation_objecttype_api_root_must_match_objecttypes_service_api_root( self,