diff options
| author | Hasan Ramezani <hasan.r67@gmail.com> | 2020-02-10 22:40:07 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-02-13 08:12:44 +0100 |
| commit | 49275c548887769cd70bbd85a3b125491f0c4062 (patch) | |
| tree | 4c954838fa6bdd8f568c69077ca357978338bf89 /django/forms/utils.py | |
| parent | da4923ea87124102aae4455e947ce24599c0365b (diff) | |
Fixed #30261 -- Prevented Form._html_output() from mutating errors if hidden fields have errors.
Diffstat (limited to 'django/forms/utils.py')
| -rw-r--r-- | django/forms/utils.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/django/forms/utils.py b/django/forms/utils.py index 5ae137943a..fbe79f1142 100644 --- a/django/forms/utils.py +++ b/django/forms/utils.py @@ -92,6 +92,11 @@ class ErrorList(UserList, list): def as_data(self): return ValidationError(self.data).error_list + def copy(self): + copy = super().copy() + copy.error_class = self.error_class + return copy + def get_json_data(self, escape_html=False): errors = [] for error in self.as_data(): |
