Skip to content

Fix department and time bonus policy crashes - #77

Open
travismolick wants to merge 2 commits into
mainfrom
fix/department-time-bonus-policies
Open

travismolick wants to merge 2 commits into
mainfrom
fix/department-time-bonus-policies

Conversation

@travismolick

@travismolick travismolick commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor
  • DepartmentPolicy was missing the App\Models\Event import. viewForEvent() threw a TypeError, so managers and volunteers got a 500 on the department list. Admins weren't affected because the Gate::before hook lets them skip policies.
  • TimeBonus didn't use the ChecksActiveEvent trait. TimeBonusPolicy::view() called isForActiveEvent(), which didn't exist, so non-managers got a 500 when viewing a single time bonus.

The new tests in #78 found both bugs. DepartmentTest and TimeBonusTest cover them.

@travismolick travismolick self-assigned this Oct 18, 2026
@travismolick travismolick added bug Something isn't working documentation Improvements or additions to documentation labels Oct 18, 2026
@travismolick
travismolick requested review from a team and Gawdl3y October 18, 2026 22:11
@travismolick
travismolick marked this pull request as ready for review October 18, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant