def METHOD_NAME(request):
    id_ = request.matchdict["sponsor_id"]
    try:
        sponsor = request.db.query(Sponsor).filter(Sponsor.id == id_).one()
    except NoResultFound:
        raise HTTPNotFound
    form = SponsorForm(request.POST if request.method == "POST" else None, sponsor)
    if request.method == "POST":
        if _color_logo_url := _upload_image("color_logo", request, form):
            form.color_logo_url.data = _color_logo_url
        if _white_logo_url := _upload_image("white_logo", request, form):
            form.white_logo_url.data = _white_logo_url
        if form.validate():
            form.populate_obj(sponsor)
            request.session.flash("Sponsor updated", queue="success")
            return HTTPSeeOther(location=request.current_route_path())
    return {"sponsor": sponsor, "form": form}