Improve allowed running records (#528)

This commit is contained in:
Kevin Papst
2019-01-29 20:45:04 +01:00
committed by GitHub
parent fe4c3c10d6
commit 974806d145
4 changed files with 14 additions and 8 deletions

View File

@@ -165,11 +165,12 @@ class TimesheetController extends AbstractController
if (count($errors) > 0) {
$this->flashError('timesheet.start.error', ['%reason%' => $errors[0]->getPropertyPath() . ' = ' . $errors[0]->getMessage()]);
} else {
$entityManager = $this->getDoctrine()->getManager();
$entityManager->persist($entry);
$this->stopActiveEntries($user);
$entityManager = $this->getDoctrine()->getManager();
$entityManager->persist($entry);
$entityManager->flush();
$this->flashSuccess('timesheet.start.success');
}
} catch (\Exception $ex) {