<commit_before>from django import forms
from django.utils.translation import ugettext_lazy as _
from django.conf import settings

from models import StaffMember

if 'tinymce' in settings.INSTALLED_APPS:
    from tinymce.widgets import TinyMCE
    widget = TinyMCE(attrs={'cols': 80, 'rows': 30})
else:
    widget = forms.Textarea()

class StaffMemberForm(forms.ModelForm):
    bio = forms.CharField(widget=widget)
    class Meta:
        model = StaffMember
        exclude = ('slug','first_name','last_name')


class ContactForm(forms.Form):
    name = forms.CharField(label=_('Your Name'))
    email = forms.EmailField(label=_('Your Email'))
    message = forms.CharField(label=_('Message'), widget=forms.Textarea)<commit_msg>Refactored a few settings to work better with current standards.<commit_after>from django import forms
from django.utils.translation import ugettext_lazy as _
from django.conf import settings

from models import StaffMember

USE_TINYMCE = getattr(settings, 'STAFF_USE_TINYMCE', True)
if 'tinymce' in settings.INSTALLED_APPS and USE_TINYMCE:
    from tinymce.widgets import TinyMCE
    WIDGET = TinyMCE(attrs={'cols': 80, 'rows': 30})
else:
    WIDGET = forms.Textarea()

class StaffMemberForm(forms.ModelForm):
    """
    Basic form for entering data about the staff member. Changes the bio
    field to a tinyMCE widget if specified.
    """
    bio = forms.CharField(widget=WIDGET)
    
    class Meta:
        model = StaffMember
        exclude = ('slug', 'first_name', 'last_name')


class ContactForm(forms.Form):
    """
    A simple contact form to allow contacting the staff
    """
    name = forms.CharField(label=_('Your Name'))
    email = forms.EmailField(label=_('Your Email'))
    message = forms.CharField(label=_('Message'), widget=forms.Textarea)
{'fraction_non_alphanumeric': 0.10702341137123746, 'fraction_numerical': 0.004459308807134894, 'mean_word_length': 4.233236151603498, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5725349', 'n_tokens_mistral': 557, 'n_tokens_neox': 541, 'n_words': 152}