Quellcode durchsuchen

Only commit DB transaction after voting code is set to used

master
Les De Ridder vor 3 Jahren
Ursprung
Commit
5b68c912d1
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. +1
    -1
      app/Http/Controllers/PollController.php

+ 1
- 1
app/Http/Controllers/PollController.php Datei anzeigen

@ -275,7 +275,6 @@ class PollController extends Controller
$vote->poll_option_id = $option;
$poll->votes()->save($vote);
}
DB::commit();
if($poll->duplicate_vote_checking == 'cookies') {
$request->session()->put($poll->id, null);
@ -285,6 +284,7 @@ class PollController extends Controller
$code->used = true;
$code->save();
}
DB::commit();
return redirect()->action('PollController@viewResults', ['poll' => $poll])->with('voted', true);
}


Laden…
Abbrechen
Speichern