Skip to content

Conversation

sthzg
Copy link

@sthzg sthzg commented Aug 7, 2014

I added a warning about returning non-utf8-encoded strings from within def __unicode__(), as I found it resulting in a 500 response and a plugin instance marked as <Empty>. After returning as UTF8 everything was working as expected. If you can't confirm these issues to be related, feel that the addition is not accurate enough or doesn't make sense for documentation readers, feel free to drop it.

I added a warning about returning non-utf8-encoded strings from within ``def __unicode__()``, as I found it resulting in a 500 response and a plugin instance marked as <Empty>. After returning as UTF8 everything worked as expected. If you can't confirm these issues to be related or feel that the addition doesn't make sense for documentation readers, feel free to drop it.
@mmarzantowicz
Copy link

It's already documented here: https://docs.djangoproject.com/en/dev/ref/unicode/#models . You should also consider using from __future__ import unicode_literals instead of u'...' in your model modules.

@sthzg
Copy link
Author

sthzg commented Aug 7, 2014

Yes, normally I import the unicode_literals, took some time until I've noticed that they were missing. I was going to mention that it is more of a Django issue, but the advantage in plain Django is that you see the quite verbose exception directly, while when happening in DCMS there is no visible error on screen and the exception is not printed out on the terminal, just one line with a 500 response code in runserver.

digi604 added a commit that referenced this pull request Aug 11, 2014
@digi604 digi604 merged commit 8739710 into django-cms:develop Aug 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants