Commit e5669da5 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

[FIX] Création/modification d'individu : erreur 'Adresse existante (Individu)'.

parent fe92e1a7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -34,13 +34,13 @@ class NewEmailValidator extends AbstractValidator
        $perimetre = $this->getPerimetre();

        if (in_array('utilisateur', $perimetre)) {
            if ($this->entityManager->getRepository(Individu::class)->findOneBy(['email' => $value]) !== null) {
            if ($this->entityManager->getRepository(Utilisateur::class)->findOneBy(['email' => $value]) !== null) {
                $this->error(self::UTILISATEUR);
                $nb_pb++;
            }
        }
        if (in_array('individu', $perimetre)) {
            if ($this->entityManager->getRepository(Utilisateur::class)->findOneBy(['email' => $value]) !== null) {
            if ($this->entityManager->getRepository(Individu::class)->findOneBy(['email' => $value]) !== null) {
                $this->error(self::INDIVIDU);
                $nb_pb++;
            }