def METHOD_NAME(request, year, event_pk):
    fair = get_object_or_404(Fair, year=year)
    event = get_object_or_404(Event, pk=event_pk)
    form = TeamForm(
        request.POST or None, initial={"max_capacity": event.teams_default_max_capacity}
    )
    if request.POST and form.is_valid():
        # We want to add the event_id here before saving the team
        new_team = form.save(commit=False)
        new_team.event = event
        new_team.save()
        return redirect("events:event_edit", fair.year, event.id)
    return render(request, "events/team_edit.html", {"fair": fair, "form": form})