mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
DX: [absence] Remove unneccessary $em->persist()
This commit is contained in:
parent
9696a8194c
commit
b30e966316
@ -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'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user