From fa35b363252eb49b13612f30cba22382e56fd4a0 Mon Sep 17 00:00:00 2001 From: vasileios Date: Mon, 16 Dec 2024 09:54:39 +0100 Subject: [PATCH] [#4853] Fixed non required fields in registration backends serializers Backport-of: #4924 --- src/openforms/registrations/contrib/demo/config.py | 1 + src/openforms/registrations/contrib/email/config.py | 4 ++++ .../registrations/contrib/microsoft_graph/config.py | 1 + src/openforms/registrations/contrib/objects_api/config.py | 6 ++++++ src/openforms/registrations/contrib/stuf_zds/options.py | 4 ++++ 5 files changed, 16 insertions(+) diff --git a/src/openforms/registrations/contrib/demo/config.py b/src/openforms/registrations/contrib/demo/config.py index 26f9bbc77a..3c754f922f 100644 --- a/src/openforms/registrations/contrib/demo/config.py +++ b/src/openforms/registrations/contrib/demo/config.py @@ -9,4 +9,5 @@ class DemoOptionsSerializer(JsonSchemaSerializerMixin, serializers.Serializer): extra_line = serializers.CharField( label=_("Extra print statement"), required=False, + allow_blank=True, ) diff --git a/src/openforms/registrations/contrib/email/config.py b/src/openforms/registrations/contrib/email/config.py index 2d19521caa..7cda616e80 100644 --- a/src/openforms/registrations/contrib/email/config.py +++ b/src/openforms/registrations/contrib/email/config.py @@ -50,6 +50,7 @@ class EmailOptionsSerializer(JsonSchemaSerializerMixin, serializers.Serializer): "number to the submission in the subject." ), required=False, + allow_blank=True, validators=[ DjangoTemplateValidator(backend="openforms.template.openforms_backend") ], @@ -60,6 +61,7 @@ class EmailOptionsSerializer(JsonSchemaSerializerMixin, serializers.Serializer): "Subject of the email sent to the registration backend to notify a change in the payment status." ), required=False, + allow_blank=True, validators=[ DjangoTemplateValidator(backend="openforms.template.openforms_backend") ], @@ -68,6 +70,7 @@ class EmailOptionsSerializer(JsonSchemaSerializerMixin, serializers.Serializer): label=_("email content template HTML"), help_text=_("Content of the registration email message (as text)."), required=False, + allow_blank=True, validators=[ DjangoTemplateValidator( backend="openforms.template.openforms_backend", @@ -79,6 +82,7 @@ class EmailOptionsSerializer(JsonSchemaSerializerMixin, serializers.Serializer): label=_("email content template text"), help_text=_("Content of the registration email message (as text)."), required=False, + allow_blank=True, validators=[ DjangoTemplateValidator( backend="openforms.template.openforms_backend", diff --git a/src/openforms/registrations/contrib/microsoft_graph/config.py b/src/openforms/registrations/contrib/microsoft_graph/config.py index 5e0d98eb57..0daa78e852 100644 --- a/src/openforms/registrations/contrib/microsoft_graph/config.py +++ b/src/openforms/registrations/contrib/microsoft_graph/config.py @@ -37,4 +37,5 @@ class MicrosoftGraphOptionsSerializer( "ID of the drive to use. If left empty, the default drive will be used." ), required=False, + allow_blank=True, ) diff --git a/src/openforms/registrations/contrib/objects_api/config.py b/src/openforms/registrations/contrib/objects_api/config.py index c2c083fce7..7394367121 100644 --- a/src/openforms/registrations/contrib/objects_api/config.py +++ b/src/openforms/registrations/contrib/objects_api/config.py @@ -171,6 +171,7 @@ class ObjectsAPIOptionsSerializer(JsonSchemaSerializerMixin, serializers.Seriali "to be used for the submission report PDF." ), required=False, + allow_blank=True, ) informatieobjecttype_submission_csv = serializers.URLField( label=_("submission report CSV informatieobjecttype"), @@ -179,6 +180,7 @@ class ObjectsAPIOptionsSerializer(JsonSchemaSerializerMixin, serializers.Seriali "to be used for the submission report CSV." ), required=False, + allow_blank=True, ) informatieobjecttype_attachment = serializers.URLField( label=_("attachment informatieobjecttype"), @@ -187,6 +189,7 @@ class ObjectsAPIOptionsSerializer(JsonSchemaSerializerMixin, serializers.Seriali "to be used for the submission attachments." ), required=False, + allow_blank=True, ) # V1 only fields: @@ -194,6 +197,7 @@ class ObjectsAPIOptionsSerializer(JsonSchemaSerializerMixin, serializers.Seriali label=_("productaanvraag type"), help_text=_("The type of ProductAanvraag."), required=False, + allow_blank=True, ) content_json = serializers.CharField( label=_("JSON content field"), @@ -206,6 +210,7 @@ class ObjectsAPIOptionsSerializer(JsonSchemaSerializerMixin, serializers.Seriali ), ], required=False, + allow_blank=True, ) payment_status_update_json = serializers.CharField( label=_("payment status update JSON template"), @@ -219,6 +224,7 @@ class ObjectsAPIOptionsSerializer(JsonSchemaSerializerMixin, serializers.Seriali ), ], required=False, + allow_blank=True, ) # V2 only fields: diff --git a/src/openforms/registrations/contrib/stuf_zds/options.py b/src/openforms/registrations/contrib/stuf_zds/options.py index 494004ca33..ab68647341 100644 --- a/src/openforms/registrations/contrib/stuf_zds/options.py +++ b/src/openforms/registrations/contrib/stuf_zds/options.py @@ -46,20 +46,24 @@ class ZaakOptionsSerializer(JsonSchemaSerializerMixin, serializers.Serializer): ) zds_zaaktype_omschrijving = serializers.CharField( required=False, + allow_blank=True, help_text=_("Zaaktype description for newly created Zaken in StUF-ZDS"), ) zds_zaaktype_status_code = serializers.CharField( required=False, + allow_blank=True, help_text=_("Zaaktype status code for newly created zaken in StUF-ZDS"), ) zds_zaaktype_status_omschrijving = serializers.CharField( required=False, + allow_blank=True, help_text=_("Zaaktype status omschrijving for newly created zaken in StUF-ZDS"), ) zds_documenttype_omschrijving_inzending = serializers.CharField( required=True, + allow_blank=True, help_text=_("Documenttype description for newly created zaken in StUF-ZDS"), )