Commit af638445 authored by Michal Čihař's avatar Michal Čihař

Strip \\r from translated messages

parent c6f036fa
...@@ -20,12 +20,13 @@ class PluralTextarea(forms.Textarea): ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment