diff --git a/django/contrib/comments/models.py b/django/contrib/comments/models.py index 779d67b691..7424ec041a 100644 --- a/django/contrib/comments/models.py +++ b/django/contrib/comments/models.py @@ -30,11 +30,10 @@ class BaseCommentAbstractModel(models.Model): 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) ) diff --git a/django/contrib/comments/urls.py b/django/contrib/comments/urls.py index ed4f89d376..8fe4fbb6e4 100644 --- a/django/contrib/comments/urls.py +++ b/django/contrib/comments/urls.py @@ -13,3 +13,7 @@ urlpatterns = patterns('django.contrib.comments.views', 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'), +) +