Skip to content

Commit

Permalink
[#2077] TESTING MIGRATION FIX for porting
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart van der Schoor committed Feb 13, 2024
1 parent cdfd1e4 commit d1931f6
Showing 1 changed file with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Generated by Django 3.2.20 on 2023-11-20 10:07

import logging

from django.core.exceptions import ObjectDoesNotExist
from django.db import migrations, transaction
from django.db import ProgrammingError, migrations, transaction

from open_inwoner.openzaak.zgw_imports import get_configurable_zaaktypes
from open_inwoner.openzaak.clients import build_client
import logging
from open_inwoner.openzaak.zgw_imports import get_configurable_zaaktypes

logger = logging.getLogger(__name__)

Expand All @@ -18,16 +19,20 @@ def populate_zaaktype_config_urls(apps, schema_editor):
CatalogusConfig = apps.get_model("openzaak", "CatalogusConfig")
catalog_lookup = {c.url: c for c in CatalogusConfig.objects.all()}

client = build_client("catalogi")
if not client:
logger.warning(
"Not populating zaaktype config urls: could not build Catalogi API client"
)
return []
try:
client = build_client("catalogi")
if not client:
logger.warning(
"Not populating zaaktype config urls: could not build Catalogi API client"
)
return []

zaaktypes = get_configurable_zaaktypes(client)
if not zaaktypes:
return []

zaaktypes = get_configurable_zaaktypes(client)
if not zaaktypes:
return []
except ProgrammingError:
pass

with transaction.atomic():
for zaaktype in zaaktypes:
Expand Down

0 comments on commit d1931f6

Please sign in to comment.