Commit 8a053bce authored by Jozef Vajdiar's avatar Jozef Vajdiar
Browse files

Update RegistrationController.php

parent 34bb29ef
......@@ -72,8 +72,8 @@ class RegistrationController extends AbstractController
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$user = $em->getRepository(Users::class)->findOneBy(['email'=>$user->getEmail()]);
if ($user){
$userCheck = $em->getRepository(Users::class)->findOneBy(['email'=>$user->getEmail()]);
if ($userCheck){
$this->addFlash('danger','Email is already registered!');
return new RedirectResponse($this->generateUrl('fos_user_registration_register'));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment