def METHOD_NAME(request, year, participant_pk=None):
    fair = get_object_or_404(Fair, year=year)
    participant = (
        get_object_or_404(Participant, pk=participant_pk, fair=fair)
        if participant_pk is not None
        else None
    )
    form = ParticipantForm(request.POST or None, instance=participant)
    if request.POST and form.is_valid():
        form.instance.fair = fair
        participant = form.save()
        return redirect("unirel_admin_participant", fair.year, participant.pk)
    return render(
        request, "unirel/admin_participant_form.html", {"fair": fair, "form": form}
    )