summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorJaap Roes <jroes@leukeleu.nl>2021-09-22 13:28:49 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-09-24 12:14:11 +0200
commit25cfa5db0fe1919c72a437b57fffe7b87cd506ea (patch)
tree963aec14c51bc058235c1affe12913e88e5eb2c1 /django
parent5d36af6f6fe7766c1d2d3ea8c261ed22da2861af (diff)
[4.0.x] Fixed #33130 -- Restored form errors to be a dict.
Regression in 456466d932830b096d39806e291fe23ec5ed38d5. Backport of 7fe9b6f6df16fa875fe360a1c7d0ac53fcf08a53 from main
Diffstat (limited to 'django')
-rw-r--r--django/forms/utils.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/django/forms/utils.py b/django/forms/utils.py
index 44447b5cf5..4af57e8586 100644
--- a/django/forms/utils.py
+++ b/django/forms/utils.py
@@ -1,5 +1,5 @@
import json
-from collections import UserDict, UserList
+from collections import UserList
from django.conf import settings
from django.core.exceptions import ValidationError
@@ -84,7 +84,7 @@ class RenderableErrorMixin(RenderableMixin):
return self.render(self.template_name_ul)
-class ErrorDict(UserDict, RenderableErrorMixin):
+class ErrorDict(dict, RenderableErrorMixin):
"""
A collection of errors that knows how to display itself in various formats.
@@ -94,8 +94,8 @@ class ErrorDict(UserDict, RenderableErrorMixin):
template_name_text = 'django/forms/errors/dict/text.txt'
template_name_ul = 'django/forms/errors/dict/ul.html'
- def __init__(self, data=None, renderer=None):
- super().__init__(data)
+ def __init__(self, *args, renderer=None, **kwargs):
+ super().__init__(*args, **kwargs)
self.renderer = renderer or get_default_renderer()
def as_data(self):