summaryrefslogtreecommitdiff
path: root/django/forms/formsets.py
diff options
context:
space:
mode:
authormanav014 <dpsman13016@gmail.com>2020-10-21 04:18:02 +0530
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-10-21 11:47:07 +0200
commit096b14f0ac8513c5d76c1b693721b6aede18777d (patch)
tree9d05389cfe8d9052c59a10a8afa587c45a75c483 /django/forms/formsets.py
parentf5e07601b233a50e6bcca438f65fd7028277f78b (diff)
Fixed #13060 -- Improved error message when ManagementForm data is missing.
Diffstat (limited to 'django/forms/formsets.py')
-rw-r--r--django/forms/formsets.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/django/forms/formsets.py b/django/forms/formsets.py
index 32b3b4ad11..3f57399caf 100644
--- a/django/forms/formsets.py
+++ b/django/forms/formsets.py
@@ -90,7 +90,14 @@ class BaseFormSet:
form = ManagementForm(self.data, auto_id=self.auto_id, prefix=self.prefix)
if not form.is_valid():
raise ValidationError(
- _('ManagementForm data is missing or has been tampered with'),
+ _(
+ 'ManagementForm data is missing or has been tampered '
+ 'with. Missing fields: %(field_names)s'
+ ) % {
+ 'field_names': ', '.join(
+ form.add_prefix(field_name) for field_name in form.errors
+ ),
+ },
code='missing_management_form',
)
else: