Ticket #1352: trunk-show_invisible_field_errors.diff
File trunk-show_invisible_field_errors.diff, 1.5 KB (added by , 19 years ago) |
---|
-
contrib/admin/templates/admin/change_form.html
27 27 <p class="errornote"> 28 28 {% blocktrans count form.error_dict.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} 29 29 </p> 30 {% if form.error_dict_invisible %} 31 <ul class="errorlist"> 32 {% for error_field in form.error_dict_invisible.items %} 33 {% for error_message in error_field.1 %} 34 <li>Field '{{ error_field.0 }}' (not listed below): {{ error_message }}</li> 35 {% endfor %} 36 {% endfor %} 37 </ul> 30 38 {% endif %} 39 {% endif %} 31 40 {% for bound_field_set in bound_manipulator.bound_field_sets %} 32 41 <fieldset class="module aligned {{ bound_field_set.classes }}"> 33 42 {% if bound_field_set.name %}<h2>{{ bound_field_set.name }}</h2>{% endif %} -
core/formfields.py
101 101 def __init__(self, manipulator, data, error_dict, edit_inline=True): 102 102 self.manipulator, self.data = manipulator, data 103 103 self.error_dict = error_dict 104 self.error_dict_invisible = dict([(k, v) for (k, v) in self.error_dict.items() if k not in self.data]) 104 105 self._inline_collections = None 105 106 self.edit_inline = edit_inline 106 107