diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-08-27 22:51:24 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-08-27 22:51:24 +0000 |
| commit | 1106c558b1e8d141185f0b3667e374c735c8aaeb (patch) | |
| tree | f8ed24510bcbd3d7c215d0b00faffa77ecbfca4b | |
| parent | ff420b43647dd7f149f000efd2c7eb077f6ba5cf (diff) | |
Fixed #8544: correctly cast `Comment.object_pk` to string when doing lookups. This really only papers over a bigger problem related to casting the RHS of GFKs, but that larger change can wait for a more systematic fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8641 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/comments/templatetags/comments.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/contrib/comments/templatetags/comments.py b/django/contrib/comments/templatetags/comments.py index c2a99c843b..563a3ff901 100644 --- a/django/contrib/comments/templatetags/comments.py +++ b/django/contrib/comments/templatetags/comments.py @@ -3,6 +3,7 @@ from django.template.loader import render_to_string from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib import comments +from django.utils.encoding import smart_unicode register = template.Library() @@ -77,7 +78,7 @@ class BaseCommentNode(template.Node): qs = self.comment_model.objects.filter( content_type = ctype, - object_pk = object_pk, + object_pk = smart_unicode(object_pk), site__pk = settings.SITE_ID, is_public = True, ) |
