From 8dade92f7e4067d9d69728b45bc0c2d85447fc46 Mon Sep 17 00:00:00 2001 From: Thomas Rusiecki Date: Mon, 11 Nov 2024 14:47:44 -0300 Subject: [PATCH] changed form validation onto field --- evidence/forms.py | 2 +- evidence/templates/upload.html | 24 +++++++++++------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/evidence/forms.py b/evidence/forms.py index 0ac251f..a2c0020 100644 --- a/evidence/forms.py +++ b/evidence/forms.py @@ -15,7 +15,7 @@ from utils.save_snapshots import move_json, save_in_disk class UploadForm(forms.Form): evidence_file = MultipleFileField(label=_("File")) - def clean(self): + def clean_evidence_file(self): self.evidences = [] data = self.cleaned_data.get('evidence_file') if not data: diff --git a/evidence/templates/upload.html b/evidence/templates/upload.html index 2a76b76..6337b3e 100644 --- a/evidence/templates/upload.html +++ b/evidence/templates/upload.html @@ -8,22 +8,20 @@ + + + {% load django_bootstrap5 %}
{% csrf_token %} -{% if form.errors %} - -{% endif %} -{% bootstrap_form form alert_error_type="fields" %} -
+ +{% bootstrap_form form alert_error_type="none" error_css_class="alert alert-danger alert-icon alert-icon-border" %} +