Django

Code

Ticket #5370 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

newforms.ValidationError cannot accept a message created by ugettext_lazy

Reported by: ubernostrum Assigned to: nobody
Milestone: Component: Internationalization
Version: SVN Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

5370.diff (0.8 kB) - added by ubernostrum on 09/09/07 04:47:48.
Patch which allows basestring or Promise

Change History

09/09/07 04:43:45 changed by mtredinnick

  • needs_better_patch changed.
  • stage changed from Unreviewed to Ready for checkin.
  • needs_tests changed.
  • needs_docs changed.

09/09/07 04:46:04 changed by ubernostrum

  • has_patch set to 1.

09/09/07 04:47:48 changed by ubernostrum

  • attachment 5370.diff added.

Patch which allows basestring or Promise

09/09/07 21:23:25 changed by ubernostrum

  • summary changed from newforms.ValidationError cannot be accept a message created by ugettext_lazy to newforms.ValidationError cannot accept a message created by ugettext_lazy.

(fix typo in summary)

09/13/07 17:35:18 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

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

09/13/07 21:01:11 changed by gwilson

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


Add/Change #5370 (newforms.ValidationError cannot accept a message created by ugettext_lazy)




Change Properties
Action