Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed get_absolute_url() for comments. Previously, it relied on "view…

… on site"

for admin being reversible or required people to set up their own version. Now
we ship a default pattern in the comments URLs in a way that is unlikely to
clash with anything else.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8614 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c305471610e8da8589b8b7b20a1a2b6c0dcbc3d9 1 parent 157dbe2
Malcolm Tredinnick authored August 27, 2008
5  django/contrib/comments/models.py
@@ -30,11 +30,10 @@ class Meta:
30 30
 
31 31
     def get_content_object_url(self):
32 32
         """
33  
-        Get a URL suitable for redirecting to the content object. Uses the
34  
-        ``django.views.defaults.shortcut`` view, which thus must be installed.
  33
+        Get a URL suitable for redirecting to the content object.
35 34
         """
36 35
         return urlresolvers.reverse(
37  
-            "django.views.defaults.shortcut",
  36
+            "comments-url-redirect",
38 37
             args=(self.content_type_id, self.object_pk)
39 38
         )
40 39
 
4  django/contrib/comments/urls.py
@@ -13,3 +13,7 @@
13 13
     url(r'^approved/$',      'moderation.approve_done',     name='comments-approve-done'),
14 14
 )
15 15
 
  16
+urlpatterns += patterns('',
  17
+    url(r'^cr/(\d+)/(\w+)/$', 'django.views.defaults.shortcut', name='comments-url-redirect'),
  18
+)
  19
+

0 notes on commit c305471

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