Fix missing beginTransaction()

This commit is contained in:
PICHOU Kyâne 2018-05-15 21:28:17 +02:00
parent 823c41d2e4
commit a64e182076

View File

@ -161,6 +161,7 @@ class PollService {
function createPoll(Form $form) {
// Generate poll IDs, loop while poll ID already exists
$this->pollRepository->beginTransaction();
try {
if (empty($form->id)) { // User want us to generate an id for him
do {
@ -175,7 +176,6 @@ class PollService {
}
// Insert poll + slots
$this->pollRepository->beginTransaction();
$this->pollRepository->insertPoll($poll_id, $admin_poll_id, $form);
$this->slotRepository->insertSlots($poll_id, $form->getChoices());
$this->pollRepository->commit();