mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
DX: [absence] Remove unneccessary $em->persist()
This commit is contained in:
@@ -34,7 +34,6 @@ class AbsenceController extends AbstractController
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->persist($user);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirect($this->generateUrl('chill_main_user_absence_index'));
|
||||
@@ -56,11 +55,9 @@ class AbsenceController extends AbstractController
|
||||
public function unsetAbsence(Request $request)
|
||||
{
|
||||
$user = $this->getUser();
|
||||
$form = $this->createForm(AbsenceType::class, $user);
|
||||
|
||||
$user->setAbsenceStart(null);
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->persist($user);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirect($this->generateUrl('chill_main_user_absence_index'));
|
||||
|
Reference in New Issue
Block a user