зеркало из https://github.com/mozilla/pontoon.git
Fix validation of strings with leading and trailing newlines (#3003)
We use CharFields for validating original strings and translations when translations are being saved. By default, CharField strips the value of the leading and trailing whitespace: https://docs.djangoproject.com/en/4.2/ref/forms/fields/#django.forms.CharField Until now, we've been only bypassing this default for translations. From now on, we also do that for original strings.
This commit is contained in:
Родитель
517e9863da
Коммит
a2d3d2e28e
|
@ -51,5 +51,8 @@ class CreateTranslationForm(forms.Form):
|
||||||
return None
|
return None
|
||||||
return self.cleaned_data["plural_form"]
|
return self.cleaned_data["plural_form"]
|
||||||
|
|
||||||
|
def clean_original(self):
|
||||||
|
return self.data.get("original", "")
|
||||||
|
|
||||||
def clean_translation(self):
|
def clean_translation(self):
|
||||||
return self.data.get("translation", "")
|
return self.data.get("translation", "")
|
||||||
|
|
Загрузка…
Ссылка в новой задаче