Strip \\r from translated messages
This commit is contained in:
parent
c6f036fa14
commit
af63844509
@ -20,12 +20,13 @@ class PluralTextarea(forms.Textarea):
|
|||||||
return mark_safe('<br />'.join(ret))
|
return mark_safe('<br />'.join(ret))
|
||||||
|
|
||||||
def value_from_datadict(self, data, files, name):
|
def value_from_datadict(self, data, files, name):
|
||||||
ret = [smart_unicode(data.get(name, None))]
|
ret = [data.get(name, None)]
|
||||||
for idx in range(1, 10):
|
for idx in range(1, 10):
|
||||||
fieldname = '%s_%d' % (name, idx)
|
fieldname = '%s_%d' % (name, idx)
|
||||||
if not fieldname in data:
|
if not fieldname in data:
|
||||||
break
|
break
|
||||||
ret.append(smart_unicode(data.get(fieldname, None)))
|
ret.append(data.get(fieldname, None))
|
||||||
|
ret = [smart_unicode(r.replace('\r', '')) for r in ret]
|
||||||
if len(ret) == 0:
|
if len(ret) == 0:
|
||||||
return ret[0]
|
return ret[0]
|
||||||
return ret
|
return ret
|
||||||
|
Loading…
Reference in New Issue
Block a user