mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 17:39:06 +02:00
Dont call translator inside the form classes.
Translation is already done in the templates, so translator calls in form classes, are bad for performance and readability.
This commit is contained in:
parent
e7b920c4fe
commit
89acfff857
28 changed files with 1875 additions and 2259 deletions
|
@ -99,7 +99,7 @@ class SecurityController extends AbstractController
|
|||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$passwordReset->request($form->getData()['user']);
|
||||
$this->addFlash('success', $this->translator->trans('pw_reset.request.success'));
|
||||
$this->addFlash('success', 'pw_reset.request.success');
|
||||
return $this->redirectToRoute('login');
|
||||
}
|
||||
|
||||
|
@ -152,9 +152,9 @@ class SecurityController extends AbstractController
|
|||
//Try to set the new password
|
||||
$success = $passwordReset->setNewPassword($data['username'], $data['token'], $data['new_password']);
|
||||
if (!$success) {
|
||||
$this->addFlash('error', $this->translator->trans('pw_reset.new_pw.error'));
|
||||
$this->addFlash('error', 'pw_reset.new_pw.error');
|
||||
} else {
|
||||
$this->addFlash('success', $this->translator->trans('pw_reset.new_pw.success'));
|
||||
$this->addFlash('success', 'pw_reset.new_pw.success');
|
||||
return $this->redirectToRoute('login');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue