@bp.route('/<int:uid>/edit', methods=['GET', 'POST'])
@require_user
def edit(uid):
    topic = Topic.query.get_or_404(uid)
    if g.user.id != topic.account_id and not g.user.is_staff:
        return abort(403)
    form = TopicForm(obj=topic)
    if form.validate_on_submit():
        form.populate_obj(topic)
        topic.save()
        return redirect(url_for('.view', uid=uid))
    return render_template('topic/edit.html', topic=topic, form=form)
Calculate ts/tv, and avoid division by zero error
dataset/ETHPy150Open pythoncn/june/june/handlers/topic.py/edit--crossover with--dataset/ETHPy150Open arq5x/gemini/gemini/gemini_stats.py/tstv