diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index 3b899e5..665e3f7 100644
a
|
b
|
class ModelAdmin(BaseModelAdmin):
|
1321 | 1321 | opts = model._meta |
1322 | 1322 | app_label = opts.app_label |
1323 | 1323 | action_list = LogEntry.objects.filter( |
1324 | | object_id = object_id, |
| 1324 | object_id = unquote(object_id), |
1325 | 1325 | content_type__id__exact = ContentType.objects.get_for_model(model).id |
1326 | 1326 | ).select_related().order_by('action_time') |
1327 | 1327 | # If no history was found, see whether this object even exists. |
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
index f074d77..be4b32d 100644
a
|
b
|
class AdminViewStringPrimaryKeyTest(TestCase):
|
1344 | 1344 | def setUp(self): |
1345 | 1345 | self.client.login(username='super', password='secret') |
1346 | 1346 | content_type_pk = ContentType.objects.get_for_model(ModelWithStringPrimaryKey).pk |
1347 | | LogEntry.objects.log_action(100, content_type_pk, self.pk, self.pk, 2, change_message='') |
| 1347 | LogEntry.objects.log_action(100, content_type_pk, self.pk, self.pk, 2, change_message='Change message') |
1348 | 1348 | |
1349 | 1349 | def tearDown(self): |
1350 | 1350 | self.client.logout() |
… |
… |
class AdminViewStringPrimaryKeyTest(TestCase):
|
1353 | 1353 | "Retrieving the history for the object using urlencoded form of primary key should work" |
1354 | 1354 | response = self.client.get('/test_admin/admin/admin_views/modelwithstringprimarykey/%s/history/' % quote(self.pk)) |
1355 | 1355 | self.assertContains(response, escape(self.pk)) |
| 1356 | self.assertNotContains(response, 'This object doesn’t have a change history.') |
| 1357 | self.assertContains(response, 'Change message') |
1356 | 1358 | self.assertEqual(response.status_code, 200) |
1357 | 1359 | |
1358 | 1360 | def test_get_change_view(self): |