mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Revert "only prefill agents traitants of action if parcours has a referrer, otherwise null"
This reverts commit 0943366d39
.
This commit is contained in:
@@ -11,6 +11,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\EventListener;
|
||||
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
@@ -25,10 +26,8 @@ class AccompanyingPeriodWorkEventListener
|
||||
|
||||
public function prePersistAccompanyingPeriodWork(AccompanyingPeriodWork $work): void
|
||||
{
|
||||
$referrer = $work->getAccompanyingPeriod()->getUser();
|
||||
|
||||
if (null !== $referrer) {
|
||||
$work->addReferrer($referrer);
|
||||
if ($this->security->getUser() instanceof User) {
|
||||
$work->addReferrer($this->security->getUser());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user