TemplateSyntaxError - Caught an exception while rendering: coercing to Unicode: need string or buffer, NoneType found
meme-zz opened this issue · comments
Hi all,
(Python 2.6, Django 1.2 beta 1)
I've got an error while editing object in admin panel in language tabs with all empty fields..
TemplateSyntaxError at /panel/pages/page/1/
Caught an exception while rendering: coercing to Unicode: need string or buffer, NoneType found
{% if add %}{% trans "Add" %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %}
All traceback: http://dpaste.com/184318/
ps. Thanks for project, it's great! ... I'm waiting for fixes for this issue..
regards.
Make sure you NEVER use a multilingual field as the only option in unicode of a model. ALWAYS check that this field is actually filled!
A possible way to do it is:
def **unicode**(self): if self.multilingual_field: return self.multilingual_field return self.pk
Thanks.