<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def client_view(client):
 """Show client's detail."""

    if request.method == 'POST' and 'delete' in request.form:
        db.session.delete(client)
        db.session.commit()
        return redirect(url_for('.index'))

    form = ClientForm(request.form, obj=client)
    if form.validate_on_submit():
        form.populate_obj(client)
        db.session.commit()

    return render_template(
        'invenio_oauth2server/settings/client_view.html',
        client=client,
        form=form,
    )