Fixed #24226 -- Changed admin EMPTY_CHANGELIST_VALUE from (None) to -

This commit is contained in:
Tim Graham 2015-03-12 09:40:03 -04:00
parent b4d8b16e51
commit e4a578e70e
3 changed files with 6 additions and 3 deletions

View File

@ -20,7 +20,7 @@ from django.db import models
from django.utils import six
from django.utils.encoding import force_text
from django.utils.http import urlencode
from django.utils.translation import ugettext, ugettext_lazy
from django.utils.translation import ugettext
# Changelist settings
ALL_VAR = 'all'
@ -34,7 +34,7 @@ IGNORED_PARAMS = (
ALL_VAR, ORDER_VAR, ORDER_TYPE_VAR, SEARCH_VAR, IS_POPUP_VAR, TO_FIELD_VAR)
# Text to display within change-list table cells if the value is blank.
EMPTY_CHANGELIST_VALUE = ugettext_lazy('(None)')
EMPTY_CHANGELIST_VALUE = '-'
class ChangeList(object):

View File

@ -249,6 +249,9 @@ Miscellaneous
* CSS and images in ``contrib.admin`` to support Internet Explorer 6 & 7 have
been removed as these browsers have reached end-of-life.
* The text displayed for null columns in the admin changelist ``list_display``
cells has changed from ``(None)`` (or its translated equivalent) to ``-``.
* ``django.http.responses.REASON_PHRASES`` and
``django.core.handlers.wsgi.STATUS_CODE_TEXT`` have been removed. Use
Python's stdlib instead: :data:`http.client.responses` for Python 3 and

View File

@ -95,7 +95,7 @@ class ChangeListTests(TestCase):
context = Context({'cl': cl})
table_output = template.render(context)
link = reverse('admin:admin_changelist_child_change', args=(new_child.id,))
row_html = '<tbody><tr class="row1"><th class="field-name"><a href="%s">name</a></th><td class="field-parent nowrap">(None)</td></tr></tbody>' % link
row_html = '<tbody><tr class="row1"><th class="field-name"><a href="%s">name</a></th><td class="field-parent nowrap">-</td></tr></tbody>' % link
self.assertNotEqual(table_output.find(row_html), -1,
'Failed to find expected row element: %s' % table_output)