Jelajahi Sumber

Merge branch 'hotfix/V8-6989' into develop

Olivier Massot 1 tahun lalu
induk
melakukan
e23feb7cd5
1 mengubah file dengan 5 tambahan dan 1 penghapusan
  1. 5 1
      src/Service/Organization/OrganizationProfileCreator.php

+ 5 - 1
src/Service/Organization/OrganizationProfileCreator.php

@@ -10,6 +10,7 @@ use App\Enum\Organization\PrincipalTypeEnum;
 use App\Service\Network\Tree;
 use App\Service\Organization\Utils as OrganizationUtils;
 use App\Service\Security\Module;
+use App\Service\Utils\DatesUtils;
 use App\Test\Service\Organization\OrganizationProfileCreatorTest;
 
 /**
@@ -43,7 +44,10 @@ class OrganizationProfileCreator
         );
 
         foreach ($organization->getNetworkOrganizations() as $networkOrganization) {
-            $organizationProfile->addNetwork($networkOrganization->getNetwork()->getName());
+            // TODO: fix temporaire => retirer ce 'if' dès la résolution de https://ressources-opentalent.atlassian.net/browse/V8-6985
+            if ($networkOrganization->getEndDate() === null || $networkOrganization->getEndDate() > DatesUtils::new()) {
+                $organizationProfile->addNetwork($networkOrganization->getNetwork()->getName());
+            }
         }
 
         /** @var Organization $parent */