Fix missing beginTransaction()
This commit is contained in:
parent
823c41d2e4
commit
a64e182076
@ -161,6 +161,7 @@ class PollService {
|
|||||||
function createPoll(Form $form) {
|
function createPoll(Form $form) {
|
||||||
// Generate poll IDs, loop while poll ID already exists
|
// Generate poll IDs, loop while poll ID already exists
|
||||||
|
|
||||||
|
$this->pollRepository->beginTransaction();
|
||||||
try {
|
try {
|
||||||
if (empty($form->id)) { // User want us to generate an id for him
|
if (empty($form->id)) { // User want us to generate an id for him
|
||||||
do {
|
do {
|
||||||
@ -175,7 +176,6 @@ class PollService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Insert poll + slots
|
// Insert poll + slots
|
||||||
$this->pollRepository->beginTransaction();
|
|
||||||
$this->pollRepository->insertPoll($poll_id, $admin_poll_id, $form);
|
$this->pollRepository->insertPoll($poll_id, $admin_poll_id, $form);
|
||||||
$this->slotRepository->insertSlots($poll_id, $form->getChoices());
|
$this->slotRepository->insertSlots($poll_id, $form->getChoices());
|
||||||
$this->pollRepository->commit();
|
$this->pollRepository->commit();
|
||||||
|
Loading…
Reference in New Issue
Block a user