Monday, May 9, 2011

Re: Error (EXTERNAL IP): /add_comment/10/

> message = "Comment was was added to '%s' by '%s': \n\n%s" % (self.post, self.author, self.body)

Most likely your users are posting utf-8 data which you are trying to insert into a byte string .

To fix this change that line to:

message = u"Comment was was added to '%s' by '%s': \n\n%s" % (self.post, self.author, self.body)

(I.e. Change the format string to a Unicode string)

This is a common pitfall when dealing with user entered data.

Bye
Ulrich

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate