def METHOD_NAME(request, year, number):
    calendar = get_object_or_404(AdventCalendar, year=year)
    door = get_object_or_404(AdventDoor, calendar=calendar, number=number)
    if door.is_lottery and door.is_today:
        user = request.user
        text = request.POST.get("text")
        AdventParticipation.objects.update_or_create(
            user=user, door=door, defaults={"text": text, "when": datetime.now()}
        )
    return redirect(door.get_absolute_url())