<commit_before>from django import forms
from django.utils.translation import ugettext as _

from contact_form.forms import ContactForm 
from external.stopspam.forms.fields import HoneypotField


class EnhancedContactForm(ContactForm):
    error_css_class = 'error'
    required_css_class = 'required'

    # This field will not be displayed to web users.
    # Hopefully spam bots will fill it in.
    accept_terms = HoneypotField() 
    subject = forms.CharField(max_length=100,
                           label=_('Subject'))
                                    
    
    def __init__(self, data=None, files=None, request=None, *args, **kwargs):
        if request is None:
            raise TypeError("Keyword argument 'request' must be supplied")

        if request.user.is_authenticated():
            kwargs['initial'] = {'name' : request.user.get_full_name() if request.user.get_full_name() != u''  else request.user.username,
                                 'email' : request.user.email}
            
        super(EnhancedContactForm, self).__init__(data=data, 
                                                  files=files, 
                                                  request=request, 
                                                  *args, <commit_msg>Removed bug of still having external prefix.<commit_after>from django import forms
from django.utils.translation import ugettext as _

from contact_form.forms import ContactForm 
from stopspam.forms.fields import HoneypotField


class EnhancedContactForm(ContactForm):
    error_css_class = 'error'
    required_css_class = 'required'

    # This field will not be displayed to web users.
    # Hopefully spam bots will fill it in.
    accept_terms = HoneypotField() 
    subject = forms.CharField(max_length=100,
                           label=_('Subject'))
                                    
    
    def __init__(self, data=None, files=None, request=None, *args, **kwargs):
        if request is None:
            raise TypeError("Keyword argument 'request' must be supplied")

        if request.user.is_authenticated():
            kwargs['initial'] = {'name' : request.user.get_full_name() if request.user.get_full_name() != u''  else request.user.username,
                                 'email' : request.user.email}
            
        super(EnhancedContactForm, self).__init__(data=data, 
                                                  files=files, 
                                                  request=request, 
                                                  *args, 
{'fraction_non_alphanumeric': 0.08177570093457943, 'fraction_numerical': 0.002336448598130841, 'mean_word_length': 1.7593984962406015, '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': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3077267', 'n_tokens_mistral': 643, 'n_tokens_neox': 608, 'n_words': 164}