fix error in user loading and validate scope/user consistency

This commit is contained in:
2018-08-29 23:18:37 +02:00
parent 7b7d30797f
commit 6e8f72f5cc
5 changed files with 31 additions and 21 deletions

View File

@@ -295,18 +295,19 @@ class ActivityController extends Controller
$this->get('translator')
->trans('Success : activity updated!')
);
//die();
return $this->redirect($this->generateUrl('chill_activity_activity_show', array('id' => $id, 'person_id' => $person_id)));
}
$this->get('session')
->getFlashBag()
->add('danger',
->add('error',
$this->get('translator')
->trans('The form is not valid. The activity has not been updated !')
->trans('This form contains errors')
);
return $this->render('ChillActivityBundle:Activity:edit.html.twig', array(
'person' => $entity->getPerson(),
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),