Opened 8 years ago

Closed 8 years ago

#4904 closed (duplicate)

newforms.ValidationError doesn't accept translated strings

Reported by: Thomas Steinacher <tom@…> Owned by: nobody
Component: Forms Version: master
Severity: Keywords:
Cc: djoume@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

>>> from django.utils.translation import ugettext_lazy as _
>>> from django.newforms import ValidationError
>>> ValidationError(_(u'Hello'))
Traceback (most recent call last):
  File "<console>", line 1, in ?
  File "/home/tom/django/django/newforms/util.py", line 50, in __init__
    assert isinstance(message, basestring), ("%s should be a basestring" % repr(message))
AssertionError: <django.utils.functional.__proxy__ object at 0xb760a4ec> should be a basestring
>>>

Attachments (1)

newforms.diff (535 bytes) - added by Thomas Steinacher <tom@…> 8 years ago.
let's just remove the assertion

Download all attachments as: .zip

Change History (5)

comment:1 Changed 8 years ago by anonymous

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

Changed 8 years ago by Thomas Steinacher <tom@…>

let's just remove the assertion

comment:2 Changed 8 years ago by Thomas Steinacher <tom@…>

  • Has patch set

comment:3 Changed 8 years ago by anonymous

Any update on this?

comment:4 Changed 8 years ago by Thomas Steinacher <tom@…>

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

Looks like #5370 has a slightly better patch.

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