Fix the check for deleting the last slot

This commit is contained in:
Olivier PEREZ 2015-10-05 23:50:00 +02:00
parent 112c6e29e7
commit b61f60155e

View File

@ -117,7 +117,10 @@ class AdminPollService {
$slots = $this->pollService->allSlotsByPoll($poll);
if (count($slots) === 1) {
// We can't delete the last slot
if ($poll->format == 'D' && count($slots) === 1 && strpos($slots[0]->moments, ',') === -1) {
return false;
} elseif ($poll->format == 'A' && count($slots) === 1) {
return false;
}