Skip to content

Commit 7e16f2c

Browse files
committed
Remove optional migration and tests for backport
This migration is not strictly necessary for the import/export feature, which is the focus of the v1.21.4 backport, to function. To avoid migration conflicts now and in future, we'll remove the migration and skip the tests that depend on them.
1 parent d4a697e commit 7e16f2c

File tree

3 files changed

+27
-29
lines changed

3 files changed

+27
-29
lines changed

src/open_inwoner/openzaak/migrations/0056_remove_zaaktypeconfig_unique_identificatie_in_catalogus_and_more.py

-29
This file was deleted.

src/open_inwoner/openzaak/models.py

+24
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,12 @@ class ZaakTypeConfig(models.Model):
555555

556556
class Meta:
557557
verbose_name = _("Zaaktype Configuration")
558+
constraints = [
559+
UniqueConstraint(
560+
name="unique_identificatie_in_catalogus",
561+
fields=["catalogus", "identificatie"],
562+
),
563+
]
558564

559565
@property
560566
def catalogus_url(self):
@@ -610,6 +616,12 @@ class ZaakTypeInformatieObjectTypeConfig(models.Model):
610616

611617
class Meta:
612618
verbose_name = _("Zaaktype Information Object Configuration")
619+
constraints = [
620+
UniqueConstraint(
621+
name="unique_zaaktype_config_informatieobjecttype_url",
622+
fields=["zaaktype_config", "informatieobjecttype_url"],
623+
)
624+
]
613625

614626
def informatieobjecttype_uuid(self):
615627
if self.informatieobjecttype_url:
@@ -742,6 +754,12 @@ class ZaakTypeStatusTypeConfig(models.Model):
742754

743755
class Meta:
744756
verbose_name = _("Zaaktype Statustype Configuration")
757+
constraints = [
758+
UniqueConstraint(
759+
name="unique_zaaktype_config_statustype_url",
760+
fields=["zaaktype_config", "statustype_url"],
761+
)
762+
]
745763

746764
def __str__(self):
747765
return f"{self.zaaktype_config.identificatie} - {self.omschrijving} [{self.zaaktype_config.catalogus.base_url}]"
@@ -786,6 +804,12 @@ class ZaakTypeResultaatTypeConfig(models.Model):
786804

787805
class Meta:
788806
verbose_name = _("Zaaktype Resultaattype Configuration")
807+
constraints = [
808+
UniqueConstraint(
809+
name="unique_zaaktype_config_resultaattype_url",
810+
fields=["zaaktype_config", "resultaattype_url"],
811+
)
812+
]
789813

790814
def __str__(self):
791815
return f"{self.zaaktype_config.identificatie} - {self.omschrijving} [{self.zaaktype_config.catalogus.base_url}]"

src/open_inwoner/openzaak/tests/test_import_export.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import dataclasses
22
import io
33
import uuid
4+
from unittest import skip
45

56
from django.core.files.storage.memory import InMemoryStorage
67
from django.test import TestCase
@@ -526,6 +527,7 @@ def test_import_jsonl_update_statustype_config_missing_zt_config(self):
526527
self.assertEqual(ZaakTypeStatusTypeConfig.objects.count(), 1)
527528
self.assertEqual(ZaakTypeResultaatTypeConfig.objects.count(), 1)
528529

530+
@skip("Disabled for v1.21.4 backport")
529531
def test_import_jsonl_update_reports_duplicate_db_records(self):
530532
mocks = ZGWExportImportMockData()
531533

@@ -565,6 +567,7 @@ def test_import_jsonl_update_reports_duplicate_db_records(self):
565567
# check import
566568
self.assertEqual(import_result, import_expected)
567569

570+
@skip("Disabled for v1.21.4 backport")
568571
def test_import_jsonl_update_reports_duplicate_natural_keys_in_upload_file(self):
569572
mocks = ZGWExportImportMockData(with_dupes=True)
570573

0 commit comments

Comments
 (0)