Skip to content

Commit

Permalink
Merge pull request #4868 from open-formulieren/task/3283-removing-stu…
Browse files Browse the repository at this point in the history
…f-zds-plugin-conversion

Removing StUF-ZDS plugin conversion
  • Loading branch information
sergei-maertens authored Nov 28, 2024
2 parents f0aa235 + ddb9f9a commit 65133e1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 72 deletions.
7 changes: 7 additions & 0 deletions docs/installation/upgrade-300.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,10 @@ Removal of legacy translations conversion
Old (from before Open Forms 2.4) form export files containing form field translations
in the legacy format are now ignored instead of converted to the new format. We
recommend re-creating the exports on a newer version of Open Forms.

StUF-ZDS payments extension conversion
--------------------------------------

The import conversion of StUF-ZDS plugin extensions, back to the default StUF-ZDS plugin,
has been removed. We recommend re-creating the exports on a newer version of Open Forms,
or manually changing the plugin to `stuf-zds-create-zaak` in the export files.
16 changes: 0 additions & 16 deletions src/openforms/forms/api/serializers/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,6 @@ def get_fields(self):
fields["backend"].choices = registration_register.get_choices()
return fields

def to_internal_value(self, data):

if self.context.get("is_import", False):
if data.get("backend") == "stuf-zds-create-zaak:ext-utrecht":
from openforms.registrations.contrib.stuf_zds.plugin import (
PLUGIN_IDENTIFIER,
)

warnings.warn(
"The automatic conversion from StUF-ZDS payments extension to "
"StUF-ZDS during import will be removed in Open Forms 3.0",
category=DeprecationWarning,
)
data["backend"] = PLUGIN_IDENTIFIER
return super().to_internal_value(data)

def validate(self, attrs):
# validate config options with selected plugin
if "backend" not in attrs:
Expand Down
56 changes: 0 additions & 56 deletions src/openforms/forms/tests/test_import_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -1613,59 +1613,3 @@ def test_import_form_with_zgw_registration_backend_cant_determine_objects_api_gr
registration_backend.options["objects_api_group"],
objects_api_group.pk,
)


class ImportStUFZDSTests(TempdirMixin, TestCase):
def test_extension_plugin_id_is_converted(self):
resources = {
"forms": [
{
"active": True,
"name": "Test Form 1",
"internal_name": "Test Form Internal 1",
"slug": "zds-from-extension",
"uuid": "324cadce-a627-4e3f-b117-37ca232f16b2",
"registration_backends": [
{
"key": "test-backend",
"name": "Test backend",
"backend": "stuf-zds-create-zaak:ext-utrecht",
"options": {
"zds_zaaktype_code": "TEST",
"zds_documenttype_omschrijving_inzending": "omschrijving",
"zds_zaakdoc_vertrouwelijkheid": "VERTROUWELIJK",
"payment_status_update_mapping": [
{
"form_variable": "provider_payment_ids",
"stuf_name": "providerPaymentID",
}
],
},
}
],
}
]
}

with zipfile.ZipFile(self.filepath, "w") as zip_file:
for name, data in resources.items():
zip_file.writestr(f"{name}.json", json.dumps(data))

call_command("import", import_file=self.filepath)

registration_backend = FormRegistrationBackend.objects.get(key="test-backend")
self.assertEqual(registration_backend.backend, "stuf-zds-create-zaak")
self.assertEqual(
registration_backend.options,
{
"zds_zaaktype_code": "TEST",
"zds_documenttype_omschrijving_inzending": "omschrijving",
"zds_zaakdoc_vertrouwelijkheid": "VERTROUWELIJK",
"payment_status_update_mapping": [
{
"form_variable": "provider_payment_ids",
"stuf_name": "providerPaymentID",
}
],
},
)

0 comments on commit 65133e1

Please sign in to comment.