Fix bug in advancement

No shows would not be seen as scored and would block the advancement.
This commit is contained in:
Matt Young 2024-11-07 16:26:39 -06:00
parent 9eaccbce95
commit fe8f74372b
1 changed files with 4 additions and 1 deletions

View File

@ -12,6 +12,7 @@ use Illuminate\Support\Facades\Cache;
class AdvancementController extends Controller
{
protected RankAuditionEntries $ranker;
public function __construct(RankAuditionEntries $ranker)
{
$this->ranker = $ranker;
@ -58,7 +59,7 @@ class AdvancementController extends Controller
$entries->load('advancementVotes');
$scoringComplete = $entries->every(function ($entry) {
return $entry->score_totals[0] >= 0;
return $entry->score_totals[0] >= 0 || $entry->hasFlag('no_show');
});
return view('tabulation.advancement.ranking', compact('audition', 'entries', 'scoringComplete'));
@ -74,6 +75,7 @@ class AdvancementController extends Controller
$entry->addFlag('will_advance');
}
Cache::forget('audition'.$audition->id.'advancement');
return redirect()->route('advancement.ranking', ['audition' => $audition->id])->with('success',
'Passers have been set successfully');
}
@ -85,6 +87,7 @@ class AdvancementController extends Controller
$entry->removeFlag('will_advance');
}
Cache::forget('audition'.$audition->id.'advancement');
return redirect()->route('advancement.ranking', ['audition' => $audition->id])->with('success',
'Passers have been cleared successfully');
}