Fixed ascii_validator
This commit is contained in:
parent
b9ba692a42
commit
7c64197468
|
@ -97,7 +97,7 @@ def validate_name(value):
|
|||
def validate_ascii(value):
|
||||
try:
|
||||
value.encode('ascii')
|
||||
except UnicodeDecodeError:
|
||||
except UnicodeEncodeError:
|
||||
raise ValidationError('This is not an ASCII string.')
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue