Commits

Anonymous committed 1fa87f4

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.

  • Participants
  • Parent commits b9cd36b

Comments (0)

Files changed (2)

File django/contrib/comments/models.py

 
     def get_content_object_url(self):
         """
-        Get a URL suitable for redirecting to the content object. Uses the
-        ``django.views.defaults.shortcut`` view, which thus must be installed.
+        Get a URL suitable for redirecting to the content object.
         """
         return urlresolvers.reverse(
-            "django.views.defaults.shortcut",
+            "comments-url-redirect",
             args=(self.content_type_id, self.object_pk)
         )
 

File django/contrib/comments/urls.py

     url(r'^approved/$',      'moderation.approve_done',     name='comments-approve-done'),
 )
 
+urlpatterns += patterns('',
+    url(r'^cr/(\d+)/(\w+)/$', 'django.views.defaults.shortcut', name='comments-url-redirect'),
+)
+