Builds the referee workflow end to end: club-defined RefereeLevel/RefereeProfile eligibility tied to teams, EventReferee assignment (member or external, with fee/km payment tracking), an admin dashboard with KPI tiles, date-grouped game tiles and range filters, and a downloadable payment form PDF modeled on the club's existing paper document (using Club.legal_name when set). Also lands team roster bulk-add, member mass-upload with family linking, and the members.Group model, developed alongside this work. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
18 lines
761 B
Python
18 lines
761 B
Python
from django.utils import timezone
|
|
|
|
from club.models import ClubMembership, Season
|
|
from members.models import Member
|
|
|
|
|
|
def eligible_roster_members(club):
|
|
"""Members eligible to be added to a team's roster or staff: active (paid) for
|
|
the club this season or next, regardless of which season's roster/staff list is
|
|
currently being edited (the team page's season switcher can point at either)."""
|
|
today = timezone.localdate()
|
|
eligible_seasons = [season for season in (Season.covering(club, today), Season.next_after(club, today)) if season is not None]
|
|
return Member.objects.filter(
|
|
member_of__club=club,
|
|
member_of__season__in=eligible_seasons,
|
|
member_of__status=ClubMembership.StatusChoices.ACTIVE,
|
|
).distinct()
|