Skip to content

Commit

Permalink
Fixed #8544: correctly cast Comment.object_pk to string when doing …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
jacobian committed Aug 27, 2008
1 parent ff420b4 commit 1106c55
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django/contrib/comments/templatetags/comments.py
Expand Up @@ -3,6 +3,7 @@
from django.conf import settings from django.conf import settings
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.contrib import comments from django.contrib import comments
from django.utils.encoding import smart_unicode


register = template.Library() register = template.Library()


Expand Down Expand Up @@ -77,7 +78,7 @@ def get_query_set(self, context):


qs = self.comment_model.objects.filter( qs = self.comment_model.objects.filter(
content_type = ctype, content_type = ctype,
object_pk = object_pk, object_pk = smart_unicode(object_pk),
site__pk = settings.SITE_ID, site__pk = settings.SITE_ID,
is_public = True, is_public = True,
) )
Expand Down

0 comments on commit 1106c55

Please sign in to comment.