Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pyright.pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ include = [
# Validations app
"src/openforms/validations/api/serializers.py",
"src/geo_visualization",
# (temporary) migration tool
"src/openforms/forms/management/commands/migrate_catalogi_api_urls.py",
"src/openforms/tests/test_zgw_urls_migrator.py",
"src/openforms/zgw_urls_migrator.py",
]
exclude = [
"**/__pycache__",
Expand Down
2 changes: 1 addition & 1 deletion src/openforms/conf/locale/nl/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -12611,7 +12611,7 @@ msgstr "Documenttypeomschrijving"

#: openforms/registrations/contrib/zgw_apis/options.py:85
msgid ""
"The document type will be retrived in the specified catalogue. The version "
"The document type will be retrieved in the specified catalogue. The version "
"will automatically be selected based on the submission completion timestamp."
" When you specify this field, you MUST also specify the case type via its "
"identification. Only document types related to the case type are valid."
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from django.core.management import BaseCommand, CommandError
from django.db import transaction

from openforms.zgw_urls_migrator import MigrationProblem, Migrator


class Command(BaseCommand):
help = "Report or migrate legacy Catalogi API URL usage."

def add_arguments(self, parser):
parser.add_argument(
"--no-dry-run",
"--no-dryrun",
action="store_false",
dest="dry_run",
help="Also execute the reported changes",
)

def handle(self, **options):
dry_run = options["dry_run"]
self.stdout.write(f"Running migrator, dry run: {dry_run}")

migrator = Migrator(outfile=self.stdout)
try:
with transaction.atomic():
migrator.migrate()

if dry_run:
transaction.set_rollback(True)
except MigrationProblem as exc:
raise CommandError(exc.message) from exc
2 changes: 1 addition & 1 deletion src/openforms/registrations/contrib/zgw_apis/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class ZaakOptionsSerializer(JsonSchemaSerializerMixin, serializers.Serializer):
required=False, # either htis field or informatieobjecttype (legacy) must be provided
label=_("Document type description"),
help_text=_(
"The document type will be retrived in the specified catalogue. The version "
"The document type will be retrieved in the specified catalogue. The version "
"will automatically be selected based on the submission completion "
"timestamp. When you specify this field, you MUST also specify the case "
"type via its identification. Only document types related to the case type "
Expand Down
Loading
Loading