Skip to content

Commit

Permalink
fix: Fixing new admin users
Browse files Browse the repository at this point in the history
  • Loading branch information
rogeriolino committed Jan 18, 2025
1 parent a90eeeb commit 6777b5d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Controller/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ private function form(
}
}

if (!count($entity->getLotacoes())) {
if (!$entity->isAdmin() && !count($entity->getLotacoes())) {
throw new Exception($translator->trans('error.no_lotation', [], NovosgaUsersBundle::getDomain()));
}

Expand All @@ -305,8 +305,7 @@ private function form(

$entity
->setSenha($encoded)
->setAtivo(true)
->setAdmin(false);
->setAtivo(true);
}

$em->persist($entity);
Expand Down

0 comments on commit 6777b5d

Please sign in to comment.