Author: kmtracey
Date: 2009-12-10 14:01:59 -0600 (Thu, 10 Dec 2009)
New Revision: 11809

Modified:
   django/branches/releases/1.1.X/
   django/branches/releases/1.1.X/django/contrib/admin/options.py
   django/branches/releases/1.1.X/tests/regressiontests/admin_views/tests.py
Log:
[1.1.X] Fixed #12349: Added missing unquote in admin history view. Thanks for 
the report guard.

r11808 from trunk.



Property changes on: django/branches/releases/1.1.X
___________________________________________________________________
Name: svnmerge-integrated
   - 
/django/trunk:1-11500,11523,11527-11528,11531-11552,11554,11577,11579-11581,11588-11589,11591-11592,11596-11599,11601-11617,11619-11626,11628-11635,11637-11638,11643-11644,11648-11653,11656,11670,11678,11681,11684,11686,11688,11697,11699,11701
   + 
/django/trunk:1-11500,11523,11527-11528,11531-11552,11554,11577,11579-11581,11588-11589,11591-11592,11596-11599,11601-11617,11619-11626,11628-11635,11637-11638,11643-11644,11648-11653,11656,11670,11678,11681,11684,11686,11688,11697,11699,11701,11808

Modified: django/branches/releases/1.1.X/django/contrib/admin/options.py
===================================================================
--- django/branches/releases/1.1.X/django/contrib/admin/options.py      
2009-12-10 19:58:20 UTC (rev 11808)
+++ django/branches/releases/1.1.X/django/contrib/admin/options.py      
2009-12-10 20:01:59 UTC (rev 11809)
@@ -1052,7 +1052,7 @@
             content_type__id__exact = 
ContentType.objects.get_for_model(model).id
         ).select_related().order_by('action_time')
         # 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,

Modified: 
django/branches/releases/1.1.X/tests/regressiontests/admin_views/tests.py
===================================================================
--- django/branches/releases/1.1.X/tests/regressiontests/admin_views/tests.py   
2009-12-10 19:58:20 UTC (rev 11808)
+++ django/branches/releases/1.1.X/tests/regressiontests/admin_views/tests.py   
2009-12-10 20:01:59 UTC (rev 11809)
@@ -610,6 +610,12 @@
     def tearDown(self):
         self.client.logout()
 
+    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.pk))
+        self.assertContains(response, escape(self.pk))
+        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(self.pk))

--

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.


Reply via email to