Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#5370 closed (fixed)

newforms.ValidationError cannot accept a message created by ugettext_lazy

Reported by: James Bennett Owned by: nobody
Component: Internationalization Version: dev
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently, if ugettext_lazy is used on the error message passed to the newforms ValidationError it will raise AssertionError because the message is expected to be either a list or a basestring. The assertion should instead allow for an instance of django.utils.functional.Promise (as the oldforms ValidationError already does).

Attachments (1)

5370.diff (860 bytes ) - added by James Bennett 17 years ago.
Patch which allows basestring or Promise

Download all attachments as: .zip

Change History (6)

comment:1 by Malcolm Tredinnick, 17 years ago

Triage Stage: UnreviewedReady for checkin

comment:2 by James Bennett, 17 years ago

Has patch: set

by James Bennett, 17 years ago

Attachment: 5370.diff added

Patch which allows basestring or Promise

comment:3 by James Bennett, 17 years ago

Summary: newforms.ValidationError cannot be accept a message created by ugettext_lazynewforms.ValidationError cannot accept a message created by ugettext_lazy

(fix typo in summary)

comment:4 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(In [6140]) Fixed #5370 -- Allow lazy translations in ValidationError classes. Patch from James Bennett.

comment:5 by Gary Wilson, 17 years ago

(In [6150]) Refs #5370 -- Added tests for ValidationError messages.

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