Sunday, June 27, 2010

Re: Error using inline displays with a user profile

On Sun, Jun 27, 2010 at 1:54 PM, derek <gamesbook@gmail.com> wrote:
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/
options.py" in change_view
 900.                 change_message =
self.construct_change_message(request, form, formsets)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/
options.py" in construct_change_message
 566.                                              'object':
force_unicode(added_object)})
File "/usr/local/lib/python2.6/dist-packages/django/utils/encoding.py"
in force_unicode
 66.                 s = unicode(s)

Exception Type: TypeError at /admin/auth/user/1/
Exception Value: coercing to Unicode: need string or buffer, NoneType
found

This traceback shows the admin attempting to create a change message for the change history log. It's calling unicode() on the added object, but running into trouble because the __unicode__ method for whatever object was added is apparently returning None. Check the __unicode__ method for whatever type of object you were adding here -- it appears to return None (at least in some cases), which is not valid for a __unicode__ method. These methods must return unicode or something that can be coerced to unicode (string or buffer).

Karen
--
http://tracey.org/kmt/

--
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.

No comments:

Post a Comment