Django

Code

Ticket #8153 (closed: duplicate)

Opened 4 months ago

Last modified 4 months ago

UnicodeDecodeError in ModelAdmin (save_add and save_change)

Reported by: nfg Assigned to: nobody
Milestone: Component: django.contrib.admin
Version: SVN Keywords: unicode modeladmin save_add
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

UnicodeDecodeError? in save_add and save_change in ModelAdmin?

I experienced a UnicodeDecodeError? when I added and changed objects through the admin interface. The problem applied to objects having a unicode(self) function returning strings containing non-ASCII characters.

Django trunk revision 8225
Python version: 2.3.4

I attach a patch the admin_views regression test so that it triggers this bug, and a patch that solves the problem.

Attachments

modeladmin_options_test.diff (2.1 kB) - added by nfg on 08/07/08 10:42:43.
modeladmin_options.diff (1.6 kB) - added by nfg on 08/07/08 10:43:59.

Change History

08/07/08 10:42:43 changed by nfg

  • attachment modeladmin_options_test.diff added.

08/07/08 10:43:59 changed by nfg

  • attachment modeladmin_options.diff added.

08/07/08 10:51:27 changed by Karen Tracey <kmtracey@gmail.com>

  • status changed from new to closed.
  • needs_better_patch changed.
  • resolution set to duplicate.
  • needs_tests changed.
  • needs_docs changed.

#8151 was already opened to fix this and make sure there are no more missing force_unicode wrappers in this code, I've added a pointer to this report/patch there.

08/08/08 13:07:33 changed by mtredinnick

(In [8236]) Added a few force_unicode() calls around objects in the admin. Required for Python 2.3 compatibility. Patch from nfg.

Refs #8151, #8153.


Add/Change #8153 (UnicodeDecodeError in ModelAdmin (save_add and save_change))




Change Properties
Action