[Django]-No error message shown with crispy forms and bootstrap 3

3đź‘Ť

âś…

Change this in the forms.py.

class SomeItemAddForm(CrispyForm):
    def __init__(self, *args, **kwargs):
        super(SomeItemAddForm, self).__init__(*args, form_action='add-someitem', **kwargs)

    class Meta:
        model = SomeItem
        fields = '__all__'

You pass only one kw argument – “form_action”, and call the init function of the parent form class without some important kw args. So in general: You pass only the extra keyword argument, and you are forgot the others – from Form, ModelForm, etc …

👤simopopov

Leave a comment