Change N/A to id in the message

In some message it appear N/A, we can use id instead of it.

Closes-bug:#1418387

Change-Id: Ife75ef3e83a1aa8285e52f93a8a5cabe908e84b4
This commit is contained in:
tinytmy 2015-02-09 14:21:34 +08:00
parent 31478be673
commit 3d88478019
2 changed files with 3 additions and 3 deletions

View File

@ -800,7 +800,7 @@ class BatchAction(Action):
action_not_allowed = []
for datum_id in obj_ids:
datum = table.get_object_by_id(datum_id)
datum_display = table.get_object_display(datum) or _("N/A")
datum_display = table.get_object_display(datum) or datum_id
if not table._filter_action(self, request, datum):
action_not_allowed.append(datum_display)
LOG.info('Permission denied to %s: "%s"' %

View File

@ -1192,7 +1192,7 @@ class DataTableTests(test.TestCase):
res = http.HttpResponse(table.render())
self.assertContains(res, "multi_select_column hidden")
def test_table_action_object_display_is_none(self):
def test_table_action_object_display_is_id(self):
action_string = "my_table__toggle__1"
req = self.factory.post('/my_url/', {'action': action_string})
self.table = MyTable(req, TEST_DATA)
@ -1206,7 +1206,7 @@ class DataTableTests(test.TestCase):
handled = self.table.maybe_handle()
self.assertEqual(302, handled.status_code)
self.assertEqual("/my_url/", handled["location"])
self.assertEqual(u"Downed Item: N/A",
self.assertEqual(u"Downed Item: 1",
list(req._messages)[0].message)
def test_table_column_can_be_selected(self):