Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

[1.1.X] Fixed #12349: Added missing unquote in admin history view. Th…

…anks for the report guard.

r11808 from trunk.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 58c19c3 commit 79d8d683d226a34edc268bce0a3d9056d60ae8e8 @kmtracey kmtracey committed
2  django/contrib/admin/
@@ -1052,7 +1052,7 @@ def history_view(self, request, object_id, extra_context=None):
content_type__id__exact = ContentType.objects.get_for_model(model).id
# If no history was found, see whether this object even exists.
- obj = get_object_or_404(model, pk=object_id)
+ obj = get_object_or_404(model, pk=unquote(object_id))
context = {
'title': _('Change history: %s') % force_unicode(obj),
'action_list': action_list,
6 tests/regressiontests/admin_views/
@@ -610,6 +610,12 @@ def setUp(self):
def tearDown(self):
+ def test_get_history_view(self):
+ "Retrieving the history for the object using urlencoded form of primary key should work"
+ response = self.client.get('/test_admin/admin/admin_views/modelwithstringprimarykey/%s/history/' % quote(
+ self.assertContains(response, escape(
+ self.failUnlessEqual(response.status_code, 200)
def test_get_change_view(self):
"Retrieving the object using urlencoded form of primary key should work"
response = self.client.get('/test_admin/admin/admin_views/modelwithstringprimarykey/%s/' % quote(

0 comments on commit 79d8d68

Please sign in to comment.
Something went wrong with that request. Please try again.