1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #23712 -- Fixed KeyError with BaseForm._html_output()

This commit is contained in:
Yang Liu
2015-01-06 17:07:40 +08:00
committed by Tim Graham
parent faf0d66a80
commit 3f9ec12d9c
2 changed files with 62 additions and 3 deletions

View File

@@ -251,9 +251,14 @@ class BaseForm(object):
# that users write): if there are only top errors, we may
# not be able to conscript the last row for our purposes,
# so insert a new, empty row.
last_row = (normal_row % {'errors': '', 'label': '',
'field': '', 'help_text': '',
'html_class_attr': html_class_attr})
last_row = (normal_row % {
'errors': '',
'label': '',
'field': '',
'help_text': '',
'html_class_attr': html_class_attr,
'field_name': '',
})
output.append(last_row)
output[-1] = last_row[:-len(row_ender)] + str_hidden + row_ender
else: