<commit_before>from flask import render_template, redirect, url_for, abort, flash
from flask.ext.login import login_required
from flask.ext.rq import get_queue

from wtforms.fields import SelectField

from .. import db
from ..models import EditableHTML, Resource, ContactCategory
from . import contact
from forms import ContactForm, ContactCategoryForm, EditCategoryNameForm
from ..email import send_email

@contact.route('/', methods=['GET', 'POST'])
def index():
    editable_html_obj = EditableHTML.get_editable_html('contact')
    setattr(ContactForm,
            'category',
            SelectField('Category', choices=[(c.name, c.name) for c in ContactCategory.query.all()]))
    form = ContactForm()
    contact_email = '<EMAIL>'
    if form.validate_on_submit():
        send_email(
            to=contact_email,
            subject=form.category.data,
            template='contact/email/contact',<commit_msg>Email of contact form info is now working<commit_after>from flask import render_template, redirect, url_for, abort, flash
from flask.ext.login import login_required
from flask.ext.rq import get_queue

from wtforms.fields import SelectField

from .. import db
from ..models import EditableHTML, Resource, ContactCategory
from . import contact
from forms import ContactForm, ContactCategoryForm, EditCategoryNameForm
from ..email import send_email

@contact.route('/', methods=['GET', 'POST'])
def index():
    editable_html_obj = EditableHTML.get_editable_html('contact')
    setattr(ContactForm,
            'category',
            SelectField('Category', choices=[(c.name, c.name) for c in ContactCategory.query.all()]))
    form = ContactForm()
    contact_email = '<EMAIL>'
    if form.validate_on_submit():
        get_queue().enqueue(
            send_email,
            recipient=contact_email,
            subject=form.category.data,
            template='contact/email/contact',
{'fraction_non_alphanumeric': 0.10294117647058823, 'fraction_numerical': 0.0, 'mean_word_length': 3.8106060606060606, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6773241', 'n_tokens_mistral': 523, 'n_tokens_neox': 515, 'n_words': 143}