Opened 8 years ago

Closed 7 years ago

#5661 closed (fixed)

UnicodeDecodeError while removing objects -> no ugettext import

Reported by: pigletto Owned by: yserrano
Component: contrib.admin Version: newforms-admin
Severity: Keywords: unicode utils.py ugettext nfa-blocker
Cc: pigletto@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

File admin/util.py lacks import statement:
from django.utils.translation import ugettext as _

which causes UnicodeDecodeError.
Patch attached.

Attachments (1)

patch_rev6442_unicode.diff (450 bytes) - added by pigletto 8 years ago.

Download all attachments as: .zip

Change History (10)

Changed 8 years ago by pigletto

comment:1 Changed 8 years ago by pigletto

  • Cc pigletto@… added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 7 years ago by yserrano

  • Owner changed from nobody to yserrano

I also had this problem, but it seems it's gone away in the newer revisions (I looked at r6782)

comment:3 Changed 7 years ago by pigletto

I think problem is still there as in util.py file _(..) is used but is not explicitly imported.

comment:4 Changed 7 years ago by Karen Tracey <kmtracey@…>

Yes, it's used here:

http://code.djangoproject.com/browser/django/branches/newforms-admin/django/contrib/admin/util.py#L88

and here:

http://code.djangoproject.com/browser/django/branches/newforms-admin/django/contrib/admin/util.py#L93

without having been imported. Those are both under a "for related in opts.get_all_related_many_to_many_objects():" and and "if has_related_objs:" so you need to be deleting something with some many-to-many relations in order to trip the error.

comment:5 Changed 7 years ago by Karen Tracey <kmtracey@…>

  • Component changed from Contrib apps to Admin interface
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:6 Changed 7 years ago by Karen Tracey <kmtracey@…>

  • Keywords nfa-blocker added

Regression from trunk that limits function and has a trivial fix, so marking blocking for merge.

comment:7 Changed 7 years ago by tvrg

closing #6424 in favor of this one

comment:8 Changed 7 years ago by tvrg

closing #6438 in favor of this one

comment:9 Changed 7 years ago by brosner

  • Resolution set to fixed
  • Status changed from new to closed

(In [7225]) newforms-admin: Fixed #5661. Added a missing import.

Note: See TracTickets for help on using tickets.
Back to Top