Add Coach mode C4: create event, reusing the desktop's own EventForm
management.forms.EventForm already scopes its teams field to teams_managed_by(user, club) via EventAudienceFormMixin -- exactly the restriction a coach needs, so it's reused as-is rather than duplicated. Only a subset of the desktop form's fields is rendered (title, kind, teams, location, start, answers-close deadline); the rest stays unset, all of it optional on the model except max_referees, which is dropped from the form entirely so its own default (2) applies instead of demanding a value this screen has no field for. After a successful save, replicates management.views.EventCreateView's own notify_new_event.delay(...) call by hand, since this isn't a CreateView -- attendance sync itself is automatic via events/signals.py. "Repeat weekly" from the design mock isn't wired up this stage -- the recurring-series machinery is a separate form with its own fields; adding it is later work, not something to fake with an inert toggle. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ECGMEwrc2k4D8VQuwjstj9
This commit is contained in:
@@ -25,4 +25,5 @@ urlpatterns = [
|
||||
# Coach mode (C1-C6).
|
||||
path("coach/", coach_views.CoachTodayView.as_view(), name="coach_today"),
|
||||
path("coach/attendance/<uuid:event_id>/", coach_views.CoachAttendanceView.as_view(), name="coach_attendance"),
|
||||
path("coach/events/new/", coach_views.CoachCreateEventView.as_view(), name="coach_create_event"),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user