@bp.route('/<int:uid>/move', methods=['GET', 'POST'])
@require_user
def move(uid):
    topic = Topic.query.get_or_404(uid)
    if g.user.id != topic.account_id and not g.user.is_staff:
        return abort(403)

    if request.method == 'GET':
        return render_template('topic/move.html', topic=topic)

    urlname = request.form.get('node', None)
    if not urlname:
        return redirect(url_for('.view', uid=uid))
    node = Node.query.filter_by(urlname=urlname).first()
    if node:
        topic.move(node)
        flash(_('Move topic success.'), 'success')
    else:
        flash(_('Node not found.'), 'error')
    return redirect(url_for('.view', uid=uid))
Move a topic to another node.
dataset/ETHPy150Open pythoncn/june/june/handlers/topic.py/move