Ticket #5370: 5370.diff
File 5370.diff, 860 bytes (added by , 17 years ago) |
---|
-
django/newforms/util.py
1 1 from django.utils.html import escape 2 2 from django.utils.encoding import smart_unicode, StrAndUnicode 3 from django.utils.functional import Promise 3 4 4 5 def flatatt(attrs): 5 6 """ … … 47 48 if isinstance(message, list): 48 49 self.messages = ErrorList([smart_unicode(msg) for msg in message]) 49 50 else: 50 assert isinstance(message, basestring), ("%s should be a basestring" % repr(message))51 assert isinstance(message, (basestring, Promise)), ("%s should be a basestring or lazy translation" % repr(message)) 51 52 message = smart_unicode(message) 52 53 self.messages = ErrorList([message]) 53 54