Merge pull request #1115 from eeintech/fix_form_errors

Fix for #1111 (missing logic to check for model errors)
This commit is contained in:
Oliver 2020-11-10 10:25:09 +11:00 committed by GitHub
commit 9ac334ddd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,11 @@ class HelperForm(forms.ModelForm):
self.helper = FormHelper() self.helper = FormHelper()
self.helper.form_tag = False self.helper.form_tag = False
self.helper.form_show_errors = False
# Check for errors from model validation
# If none, disable crispy form errors
if not self.errors:
self.helper.form_show_errors = False
""" """
Create a default 'layout' for this form. Create a default 'layout' for this form.