do not include field name in error message

This commit is contained in:
Frédéric Péters 2016-11-24 10:08:16 +01:00
parent 523b1bc94a
commit 24ee4c1db5
1 changed files with 4 additions and 4 deletions

View File

@ -32,7 +32,7 @@ class NrnField(forms.CharField):
if (97 - int(value[:9]) % 97) != int(value[-2:]):
raise ValueError()
except ValueError:
raise forms.ValidationError(_('National number : Invalid Format'))
raise forms.ValidationError(_('Invalid format'))
class DateWidget(forms.TextInput):
@ -63,7 +63,7 @@ class DateField(forms.CharField):
continue
break
else:
raise forms.ValidationError(_('Birthdate : Invalid Format'))
raise forms.ValidationError(_('Invalid format'))
class StreetWidget(forms.TextInput):
@ -125,7 +125,7 @@ class NumHouseField(forms.CharField):
if not re.match("^[1-9][0-9]*$", value):
raise ValueError()
except ValueError:
raise forms.ValidationError(getattr(settings, 'A2_NUMHOUSE_ERROR_MESSAGE', _('House number : invalid format')))
raise forms.ValidationError(getattr(settings, 'A2_NUMHOUSE_ERROR_MESSAGE', _('Invalid format')))
class NumPhoneField(forms.CharField):
@ -137,4 +137,4 @@ class NumPhoneField(forms.CharField):
if not re.match("^(0|\\+|00)(\d{8,})", value):
raise ValueError()
except ValueError:
raise forms.ValidationError(getattr(settings, 'A2_NUMPHONE_ERROR_MESSAGE', _('Phone number : Invalid Format')))
raise forms.ValidationError(getattr(settings, 'A2_NUMPHONE_ERROR_MESSAGE', _('Invalid format')))