summaryrefslogtreecommitdiff
path: root/django/forms/forms.py
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2020-02-10 22:40:07 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-02-13 08:12:44 +0100
commit49275c548887769cd70bbd85a3b125491f0c4062 (patch)
tree4c954838fa6bdd8f568c69077ca357978338bf89 /django/forms/forms.py
parentda4923ea87124102aae4455e947ce24599c0365b (diff)
Fixed #30261 -- Prevented Form._html_output() from mutating errors if hidden fields have errors.
Diffstat (limited to 'django/forms/forms.py')
-rw-r--r--django/forms/forms.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/forms/forms.py b/django/forms/forms.py
index a601467e18..81c59dea33 100644
--- a/django/forms/forms.py
+++ b/django/forms/forms.py
@@ -191,7 +191,8 @@ class BaseForm:
def _html_output(self, normal_row, error_row, row_ender, help_text_html, errors_on_separate_row):
"Output HTML. Used by as_table(), as_ul(), as_p()."
- top_errors = self.non_field_errors() # Errors that should be displayed above all fields.
+ # Errors that should be displayed above all fields.
+ top_errors = self.non_field_errors().copy()
output, hidden_fields = [], []
for name, field in self.fields.items():