From ac48a77a2f20f3edefbb2e3667bb190994f69f6e Mon Sep 17 00:00:00 2001 From: Thomas Rusiecki Date: Mon, 11 Nov 2024 14:57:20 -0300 Subject: [PATCH] added success messages --- evidence/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/evidence/views.py b/evidence/views.py index 65a033b..dabcd9d 100644 --- a/evidence/views.py +++ b/evidence/views.py @@ -1,5 +1,6 @@ import json +from django.contrib import messages from urllib.parse import urlparse from django.http import HttpResponse from django.utils.translation import gettext_lazy as _ @@ -47,11 +48,11 @@ class UploadView(DashboardView, FormView): def form_valid(self, form): form.save(self.request.user) + messages.success(self.request, _("Evidence uploaded successfully.")) response = super().form_valid(form) return response def form_invalid(self, form): - #TODO: change file_input field class to "is-invalid" if any errors occur response = super().form_invalid(form) return response @@ -71,6 +72,7 @@ class ImportView(DashboardView, FormView): def form_valid(self, form): form.save() + messages.success(self.request, _("Evidence imported successfully.")) response = super().form_valid(form) return response