<commit_before># -*- coding: utf-8 -*-

"""
byceps.blueprints.tourney.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2014 <NAME>
"""

from flask import request, url_for

from ...util.framework import create_blueprint
from ...util.views import respond_created

from .models import Match, MatchComment


blueprint = create_blueprint('tourney', __name__)


# -------------------------------------------------------------------- #
# match comments


blueprint.add_url_rule(
    '/matches/<match_id>/comments/<comment_id>',
    endpoint='match_comment_view',
    build_only=True)


@blueprint.route('/matches/<match_id>/comments', methods=['POST'])
@respond_created
def match_comment_create(match_id):
    """Create a comment on a match."""
    match = Match.query.get_or_404(match_id)

    #body = request.form['body'].strip()
    body = 'enis'

    comment = MatchComment.create(match, body)

    return url_for('.match_comment_view',
                   match_id=match.id,
                   comment_id=comment.id)<commit_msg>Removed accidentally added development hack.<commit_after># -*- coding: utf-8 -*-

"""
byceps.blueprints.tourney.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2014 <NAME>
"""

from flask import request, url_for

from ...util.framework import create_blueprint
from ...util.views import respond_created

from .models import Match, MatchComment


blueprint = create_blueprint('tourney', __name__)


# -------------------------------------------------------------------- #
# match comments


blueprint.add_url_rule(
    '/matches/<match_id>/comments/<comment_id>',
    endpoint='match_comment_view',
    build_only=True)


@blueprint.route('/matches/<match_id>/comments', methods=['POST'])
@respond_created
def match_comment_create(match_id):
    """Create a comment on a match."""
    match = Match.query.get_or_404(match_id)

    body = request.form['body'].strip()

    comment = MatchComment.create(match, body)

    return url_for('.match_comment_view',
                   match_id=match.id,
                   comment_id=comment.id)
{'fraction_non_alphanumeric': 0.21628131021194605, 'fraction_numerical': 0.011560693641618497, 'mean_word_length': 2.9262759924385633, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1776612', 'n_tokens_mistral': 635, 'n_tokens_neox': 589, 'n_words': 117}