Skip to content

Commit

Permalink
🐛 [#4908] Fix bug in form variables list of configuration options
Browse files Browse the repository at this point in the history
The configuration options could be saved without specifying any form variables to include. This does not make much sense. Added a minimum length of 1 for the form variables list in the serializer (Thanks to Robin for the hint)
  • Loading branch information
viktorvanwijk committed Jan 2, 2025
1 parent e8372b9 commit 317bbe0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/openforms/registrations/contrib/json/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
from openforms.utils.mixins import JsonSchemaSerializerMixin


# TODO-4908: when you select a form variable in the configurations and then remove it again,
# it is possible to save the plugin and form without validation errors.
class JSONOptionsSerializer(JsonSchemaSerializerMixin, serializers.Serializer):
service = PrimaryKeyRelatedAsChoicesField(
queryset=Service.objects.filter(api_type=APITypes.orc),
Expand All @@ -34,6 +32,7 @@ class JSONOptionsSerializer(JsonSchemaSerializerMixin, serializers.Serializer):
label=_("Form variable key list"),
help_text=_("A list of form variables (can also include static variables) to use."),
required=True,
min_length=1,
)


Expand Down

0 comments on commit 317bbe0

Please sign in to comment.