only prefill agents traitants of action if parcours has a referrer, otherwise null

This commit is contained in:
2022-06-13 17:59:29 +02:00
parent 4719a74307
commit 0943366d39
2 changed files with 4 additions and 2 deletions

View File

@@ -26,8 +26,9 @@ class AccompanyingPeriodWorkEventListener
public function prePersistAccompanyingPeriodWork(AccompanyingPeriodWork $work): void
{
if ($this->security->getUser() instanceof User) {
$work->addReferrer($this->security->getUser());
$referrer = $work->getAccompanyingPeriod()->getUser();
if (null !== $referrer) {
$work->addReferrer($referrer);
}
}
}