Ticket #289: precise-errors.diff

File precise-errors.diff, 1.8 KB (added by Manuzhai, 19 years ago)

Patch to provide more detailed error reporting.

  • main.py

     
    77from django.utils.html import strip_tags
    88from django.utils.httpwrappers import HttpResponse, HttpResponseRedirect
    99from django.utils.text import capfirst, get_text_list
    10 from django.conf.settings import ADMIN_MEDIA_PREFIX
     10from django.conf.settings import ADMIN_MEDIA_PREFIX, DATETIME_FORMAT
    1111import operator
    1212
    1313# Text to display within changelist table cells if the value is blank.
     
    399399                    elif isinstance(f, meta.DateField):
    400400                        if field_val:
    401401                            if isinstance(f, meta.DateTimeField):
    402                                 result_repr = dateformat.format(field_val, 'N j, Y, P')
     402                                result_repr = dateformat.format(field_val, DATETIME_FORMAT)
    403403                            else:
    404404                                result_repr = dateformat.format(field_val, 'N j, Y')
    405405                        else:
     
    588588    t.append('{% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %}')
    589589    if opts.admin.save_on_top:
    590590        t.extend(_get_submit_row_template(opts, app_label, add, change, show_delete, ordered_objects))
    591     t.append('{% if form.error_dict %}<p class="errornote">Please correct the error{{ form.error_dict.items|pluralize }} below.</p>{% endif %}\n')
     591    t.append('{% if form.error_dict %}<p class="errornote">Please correct the error{{ form.error_dict.items|pluralize }} below (in: {% for error in form.error_dict.keys %}{{ error }}{% if forloop.last %}{% else %}, {% endif %}{% endfor %}).</p>{% endif %}\n')
    592592    for fieldset_name, options in admin_field_objs:
    593593        t.append('<fieldset class="module aligned %s">\n\n' % options.get('classes', ''))
    594594        if fieldset_name:
Back to Top