fix: copy organization dependency to exchange target
All checks were successful
CI/CD Pipeline / Quality Gate (push) Successful in 43s
CI/CD Pipeline / Build and Push Images (push) Successful in 22s
CI/CD Pipeline / Internal Notify (push) Successful in 0s
CI/CD Pipeline / Deploy Dev via Compose (push) Successful in 25s

This commit is contained in:
2026-08-09 12:33:48 +02:00
parent a198f7e960
commit 2c09c4cd67
2 changed files with 3 additions and 3 deletions

View File

@@ -497,7 +497,7 @@ class ExchangeConnectionService:
if not cls._requires_registry_organizations(models_to_copy):
return models_to_copy
organization_model = django_apps.get_model("registers.Organization")
organization_model = django_apps.get_model("organizations.Organization")
ordered_models = [organization_model, *models_to_copy]
unique_models = []

View File

@@ -5,9 +5,9 @@ from contextlib import suppress
from apps.exchange.models import ExchangeConnection
from apps.exchange.services import ExchangeConnectionService
from apps.parsers.models import IndustrialCertificateRecord, ParserLoadLog
from apps.registers.models import Organization
from django.db import connections
from django.test import TestCase
from organizations.models import Organization
class ExchangeConnectionServiceDependenciesTest(TestCase):
@@ -20,7 +20,7 @@ class ExchangeConnectionServiceDependenciesTest(TestCase):
self.assertEqual(models_to_copy, [ParserLoadLog])
def test_extend_models_adds_registers_organization_first(self):
def test_extend_models_adds_fk_target_organization_first(self):
models_to_copy = ExchangeConnectionService._extend_models_with_dependencies(
[IndustrialCertificateRecord]
)