<commit_before>from django import forms

from .models import Story
from cms.forms import ContentManageableModelForm


class StoryForm(ContentManageableModelForm):
    class Meta:
        model = Story
        fields = (
            'name',
            'company_name',
            'company_url',
            'category',
            'author',
            'author_email',
            'pull_quote',
            'content'
        )

    def clean_name(self):
        name = self.cleaned_data.get('name')
        story = Story.objects.filter(name=name).exclude(pk=self.instance.pk)
        if name is not None and story.exists():
            raise forms.ValidationError('Please use a unique name.')
        return name<commit_msg>Reduce textarea height in Story form<commit_after>from django import forms

from .models import Story
from cms.forms import ContentManageableModelForm


class StoryForm(ContentManageableModelForm):
    pull_quote = forms.CharField(widget=forms.Textarea(attrs={'rows': 5}))

    class Meta:
        model = Story
        fields = (
            'name',
            'company_name',
            'company_url',
            'category',
            'author',
            'author_email',
            'pull_quote',
            'content'
        )

    def clean_name(self):
        name = self.cleaned_data.get('name')
        story = Story.objects.filter(name=name).exclude(pk=self.instance.pk)
        if name is not None and story.exists():
            raise forms.ValidationError('Please use a unique name.')
        return name
{'fraction_non_alphanumeric': 0.09696186166774402, 'fraction_numerical': 0.0006464124111182935, 'mean_word_length': 2.1022044088176353, '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': '6683753', 'n_tokens_mistral': 418, 'n_tokens_neox': 412, 'n_words': 103}