Commit b6260e7c authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Clarification message

parent 3e3e1281
Loading
Loading
Loading
Loading
+7
Changes for module/Application/src/Application/Controller/AgentController.php: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -388,6 +388,13 @@ class AgentController extends AbstractActionController

        $agentByUser = $this->getAgentService()->getAgentByUser($user);
        $agentByLogin = $this->getAgentService()->getAgentByLogin($user->getUsername());
        if ($agentByUser === null AND $agentByLogin === null) {
            throw new RuntimeException(
            "
                Aucun agent de trouver depuis l'utilisateur·trice connecté·e
                [id:".$user->getId()." username:".$user->getUsername()."] 
            ",0);
        }

        return new ViewModel([
            'utilisateur' => $user,
+1 −1
Changes for module/Application/src/Application/Service/Agent/AgentService.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ class AgentService {
        try {
            $result = $qb->getQuery()->getOneOrNullResult();
        } catch (NonUniqueResultException $e) {
            throw new RuntimeException("Plusieurs Agent liés au même User [".$user->getId()."]", $e);
            throw new RuntimeException("Plusieurs Agent liés au même User [Id:".$user->getId()." Username:".$user->getUsername()."]", $e);
        }
        if ($result !== null) return $result;